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 in ( "46" , "39" , "40" , "41" , "849" , "838" , "839" , "840" , "841" , "842" , "843" , "844" , "845" , "846" , "847" , "848" , "850" , "851" , "852" , "861" , "853" , "854" , "855" , "856" , "857" , "858" , "859" , "860" , "893" , "894" , "895" , "896" , "862" , "863" , "864" , "865" , "866" , "867" , "868" , "47" , "1027" , "1028" , "48" , "1024" , "49" , "925" , "926" , "927" , "930" , "953" , "985" , "986" , "989" , "991" , "1020" , "1399" , "931" , "987" , "1327" , "1328" , "1329" , "1330" , "1331" , "1332" , "1333" , "1334" , "1335" , "1336" , "1337" , "1338" , "1339" , "1340" , "1341" , "1342" , "1343" , "1344" , "1345" , "1346" , "1347" , "1348" , "1349" , "1350" , "1351" , "1353" , "1357" , "1358" , "1359" , "1361" , "1363" , "1366" , "1367" , "1370" , "1371" , "1372" , "1373" , "1374" , "1375" , "1376" , "1377" , "1378" , "1379" , "1380" , "1381" , "1382" , "1383" , "1384" , "1385" , "1386" , "1387" , "1388" , "1389" , "1390" , "1391" , "1392" , "1393" , "1394" , "1395" , "1396" , "1397" , "1398" , "1400" , "1401" , "1402" , "1403" , "1415" , "1416" , "1417" , "1437" , "1446" , "1418" , "1419" , "1457" , "1420" , "1421" , "1422" , "1423" , "1424" , "1425" , "1426" , "1427" , "1428" , "1431" , "1429" , "1430" , "1432" , "1433" , "1434" , "1460" , "1488" , "1438" , "1439" , "1440" , "1442" , "1443" , "1444" , "1445" , "1452" , "1465" , "1477" , "1478" , "1448" , "1450" , "1453" , "1454" , "1455" , "1480" , "1481" , "1486" , "1487" , "1489" , "1490" , "1458" , "1459" , "1461" , "1462" , "1463" , "1464" , "1466" , "1467" , "1468" , "1469" , "1476" , "1472" , "1473" , "1474" , "1475" , "1479" , "1482" , "1483" , "1484" , "1485" , "922" , "1029" , "1030" , "1354" , "1355" , "1356" , "923" , "924" , "928" , "1025" , "1026" , "929" , "978" , "979" , "1011" , "980" , "932" , "933" , "934" , "943" , "944" , "935" , "936" , "937" , "938" , "939" , "940" , "941" , "942" , "988" , "945" , "946" , "957" , "958" , "959" , "960" , "961" , "962" , "990" , "1008" , "1012" , "1021" , "947" , "948" , "949" , "950" , "951" , "952" , "984" , "1003" , "1009" , "1013" , "1023" , "954" , "955" , "956" , "963" , "964" , "965" , "966" , "977" , "967" , "968" , "969" , "970" , "971" , "974" , "975" , "972" , "973" , "976" , "981" , "982" , "983" , "1010" , "1004" , "1005" , "1006" , "1007" , "1014" , "1016" , "1017" , "1018" , "1019" , "1022" , "992" , "993" , "994" , "997" , "999" , "995" , "996" , "998" , "1000" , "1001" , "1352" , "1360" , "1364" , "1368" , "1369" , "1002" , "1015" ) OR FIND_IN_SET("46", `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 in ( "46" , "39" , "40" , "41" , "849" , "838" , "839" , "840" , "841" , "842" , "843" , "844" , "845" , "846" , "847" , "848" , "850" , "851" , "852" , "861" , "853" , "854" , "855" , "856" , "857" , "858" , "859" , "860" , "893" , "894" , "895" , "896" , "862" , "863" , "864" , "865" , "866" , "867" , "868" , "47" , "1027" , "1028" , "48" , "1024" , "49" , "925" , "926" , "927" , "930" , "953" , "985" , "986" , "989" , "991" , "1020" , "1399" , "931" , "987" , "1327" , "1328" , "1329" , "1330" , "1331" , "1332" , "1333" , "1334" , "1335" , "1336" , "1337" , "1338" , "1339" , "1340" , "1341" , "1342" , "1343" , "1344" , "1345" , "1346" , "1347" , "1348" , "1349" , "1350" , "1351" , "1353" , "1357" , "1358" , "1359" , "1361" , "1363" , "1366" , "1367" , "1370" , "1371" , "1372" , "1373" , "1374" , "1375" , "1376" , "1377" , "1378" , "1379" , "1380" , "1381" , "1382" , "1383" , "1384" , "1385" , "1386" , "1387" , "1388" , "1389" , "1390" , "1391" , "1392" , "1393" , "1394" , "1395" , "1396" , "1397" , "1398" , "1400" , "1401" , "1402" , "1403" , "1415" , "1416" , "1417" , "1437" , "1446" , "1418" , "1419" , "1457" , "1420" , "1421" , "1422" , "1423" , "1424" , "1425" , "1426" , "1427" , "1428" , "1431" , "1429" , "1430" , "1432" , "1433" , "1434" , "1460" , "1488" , "1438" , "1439" , "1440" , "1442" , "1443" , "1444" , "1445" , "1452" , "1465" , "1477" , "1478" , "1448" , "1450" , "1453" , "1454" , "1455" , "1480" , "1481" , "1486" , "1487" , "1489" , "1490" , "1458" , "1459" , "1461" , "1462" , "1463" , "1464" , "1466" , "1467" , "1468" , "1469" , "1476" , "1472" , "1473" , "1474" , "1475" , "1479" , "1482" , "1483" , "1484" , "1485" , "922" , "1029" , "1030" , "1354" , "1355" , "1356" , "923" , "924" , "928" , "1025" , "1026" , "929" , "978" , "979" , "1011" , "980" , "932" , "933" , "934" , "943" , "944" , "935" , "936" , "937" , "938" , "939" , "940" , "941" , "942" , "988" , "945" , "946" , "957" , "958" , "959" , "960" , "961" , "962" , "990" , "1008" , "1012" , "1021" , "947" , "948" , "949" , "950" , "951" , "952" , "984" , "1003" , "1009" , "1013" , "1023" , "954" , "955" , "956" , "963" , "964" , "965" , "966" , "977" , "967" , "968" , "969" , "970" , "971" , "974" , "975" , "972" , "973" , "976" , "981" , "982" , "983" , "1010" , "1004" , "1005" , "1006" , "1007" , "1014" , "1016" , "1017" , "1018" , "1019" , "1022" , "992" , "993" , "994" , "997" , "999" , "995" , "996" , "998" , "1000" , "1001" , "1352" , "1360" , "1364" , "1368" , "1369" , "1002" , "1015" ) OR FIND_IN_SET("46", `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= '46' ;Array ( [0] => HY000 [1] => 2006 [2] => MySQL server has gone away ) select * from gxvg_categories where ID= '46' ;