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 6 :: QUERY->SELECT c.*, (SELECT `txt` FROM mio_titoli WHERE id_ext = c.id AND tb_ext='mio_categorie' AND nomecampo='nome' AND lang='it') AS nome, (SELECT `txt` FROM mio_testi WHERE id_ext = c.id AND tb_ext='mio_categorie' AND nomecampo='testo' AND lang='it') AS testo FROM mio_categorie c INNER JOIN mio_gruppi_sezioni gs ON c.id_gruppo_sezione = gs.id WHERE c.is_filtro=0 AND c.id =