Array ( [0] => HY000 [1] => 2006 [2] => MySQL server has gone away ) select count(products.ID) as COUNT from ( select products.ID, products.NAME as NAME, products.CODE as CODE, products.TOTAL_QUANTITY as TOTAL_QUANTITY, products.RESERVED as RESERVED, products.PRICE as PRICE from gxvg_products as products left join gxvg_categories as categories on categories.ID = products.CATEGORY_ID left join gxvg_product_filters as product_filters on product_filters.ID = products.ID where (categories.ID= "729" OR FIND_IN_SET("729", `CATEGORIES`)) and (products.NO_SHOW!= "Y" ) and (categories.ACTIVE = "Y") and (products.TOTAL_QUANTITY - products.RESERVED > 0) ) as products ;Array ( [0] => HY000 [1] => 2006 [2] => MySQL server has gone away ) select *, (products.TOTAL_QUANTITY - products.RESERVED) as CAN_BUY from ( select products.ID, products.NAME as NAME, products.CODE as CODE, products.TOTAL_QUANTITY as TOTAL_QUANTITY, products.RESERVED as RESERVED, products.PRICE as PRICE,product_filters.S_PRICE as S_PRICE_SORT, product_filters.PARAMS as PARAMS_SORT, product_filters.MARK as MARK_SORT, product_filters.STANDART as STANDART_SORT from gxvg_products as products left join gxvg_categories as categories on categories.ID = products.CATEGORY_ID left join gxvg_product_filters as product_filters on product_filters.ID = products.ID where (categories.ID= "729" OR FIND_IN_SET("729", `CATEGORIES`)) and (products.NO_SHOW!= "Y" ) and (categories.ACTIVE = "Y") and (products.TOTAL_QUANTITY - products.RESERVED > 0) ) as products order by PARAMS_SORT ASC , STANDART_SORT ASC , MARK_SORT ASC limit 0, 50 ;Array ( [0] => HY000 [1] => 2006 [2] => MySQL server has gone away ) select * from gxvg_categories where ID= '729' ;Array ( [0] => HY000 [1] => 2006 [2] => MySQL server has gone away ) select * from gxvg_categories where ID= '729' ;