SQL Query Error (SELECT c.*, ctsp.name, ctsp.description, ctsp.ref_image, ctsp.ref_image2, ctsp.ref_image3, ctsp.filename, LEFT(ctsp.description,50) AS description_, ctsp.ref_image, ctst.name AS status, ctsp.ref_category_status, COUNT(DISTINCT c2.id) AS category_count FROM (categories c, category_specifications ctsp, category_statuses ctst) LEFT JOIN categories c2 ON (c2.ref_parent_category=c.id) WHERE c.id='298amp) : 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 ''298amp' at line 17