An Error Was Encountered
Error Number: 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 'AND product_categories.deleted = 0' at line 1
SELECT product_categories.product_cat_id, category_name FROM (product_categories INNER JOIN products_to_categories ON product_categories.product_cat_id = products_to_categories.product_cat_id) INNER JOIN products ON products_to_categories.product_id = products.product_id WHERE products.product_id = AND product_categories.deleted = 0