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 '' at line 5 (1064). Query: select, l.langUKR as deflang, coalesce(l.langEN, l.langUKR) as sname,, c.nlevel, c.nstate, c.stype, c.nname, c.nhaschildren /*, as nhaschildren2*/ from r_catalog as c /*left join r_catalog as cc on */ left join r_lang as l on c.nname = where =