MySQL server has gone away SQL query : select categoryID, name, brief_description, customers_rating, Price, in_stock, customer_votes, list_price, pt.productID, default_picture, sort_order, items_sold, enabled, product_code, description, shipping_freight, po.option_value from SS_products AS pt LEFT JOIN SS_product_options_values AS po ON pt.productID=po.productID and po.optionID=36 where (in_stock>0) AND ( enabled=1 AND categoryID=9798 OR enabled=1 AND categoryID=8960 OR enabled=1 AND categoryID=8999 OR enabled=1 AND categoryID=9014 OR enabled=1 AND categoryID=9007 OR enabled=1 AND categoryID=8995 OR enabled=1 AND categoryID=9012 OR enabled=1 AND categoryID=9031 OR enabled=1 AND categoryID=8986 OR enabled=1 AND categoryID=9030 OR enabled=1 AND categoryID=6339) order by in_stock DESC, Price, name