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 'p.region_id = 0 AND p.products_' at line 8

SELECT c.categories_id, cd.categories_name, c.categories_image, c.parent_id, pb.products_brends_link FROM products AS p LEFT JOIN products_brends AS pb ON p.brend_id = pb.id LEFT JOIN products_to_categories AS ptc ON p.products_id = ptc.products_id LEFT JOIN categories AS c ON ptc.categories_id = c.categories_id LEFT JOIN categories_description AS cd ON c.categories_id = cd.categories_id WHERE pb.id = 499 p.region_id = 0 AND p.products_status = 1 GROUP BY c.categories_id