error: SELECT DISTINCT a.* FROM features AS a JOIN (SELECT x.en FROM lang_content AS x ) AS y ON y.en = a.id WHERE a.lang_id=450/site.176.content.en.html AND (a.portal_id=3 OR a.portal_id = 2) AND a.archived=0 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 '.en.html AND (a.portal_id=3 OR a.portal_id = 2) AND a.archived=0' at line 1