Table 'SS_products' is marked as crashed and should be repaired SQL query : select count(*) 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=8672 OR enabled=1 AND categoryID=8673 OR enabled=1 AND categoryID=8674 OR enabled=1 AND categoryID=8675 OR enabled=1 AND categoryID=6804) order by in_stock DESC, Price, name