SELECT carpets_prod2cat.* , carpets_products_lang.*, carpets_categories_lang.name AS parent_name
FROM carpets_prod2cat
LEFT JOIN carpets_products_lang ON carpets_products_lang.id=carpets_prod2cat.id AND carpets_products_lang.lang='EN'
LEFT JOIN carpets_categories_lang ON carpets_categories_lang.id=carpets_prod2cat.id_parent AND carpets_categories_lang.lang='EN'
WHERE carpets_prod2cat.id='57''
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 ''57''' at line 5