1064 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 'imit 20' at line 1 in: [select p.products_id,p.products_image,p.products_ename as products_name from products p,specials s WHERE p.products_id = s.products_id AND p.products_status = 1 AND s.status = 1 AND p.products_quantity > 0 imit 20]