Table './shop/SS_product_options_values' 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 enabled=1 AND categoryID=9723 OR enabled=1 AND categoryID=9551 OR enabled=1 AND categoryID=9724 OR enabled=1 AND categoryID=9556 OR enabled=1 AND categoryID=8949 OR enabled=1 AND categoryID=8950 OR enabled=1 AND categoryID=9566 OR enabled=1 AND categoryID=8951 OR enabled=1 AND categoryID=9835 OR enabled=1 AND categoryID=8952 OR enabled=1 AND categoryID=8953 OR enabled=1 AND categoryID=9552 OR enabled=1 AND categoryID=8948 order by in_stock DESC, Price, name