error: SELECT DISTINCT a.title, a.id, a.make_available FROM opportunities AS a JOIN (SELECT x.en FROM lang_content AS x JOIN (SELECT id_content FROM subject_content WHERE id_subject=1 AND id_type = 4) AS b ON x.en = b.id_content ) AS y ON y.en = a.id WHERE a.lang_id=450/site.0.enpieast.en.39.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.39.html AND (a.portal_id=3 OR a.portal_id = 2) AND a.archived=0' at line 1