You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-8, 8' at line 1 : select * from yp_product inner join yp_product_cat on yp_product.product_id = yp_product_cat.product_id inner join yp_category on yp_category.category_id = yp_product_cat.category_id where yp_product.product_status='Active' and yp_product_cat.category_id in ('92') and yp_product.category_type='83' order by yp_product.product_id ASC limit -8, 8