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 ') order by titolo' at line 1select *, cms_produttori.id as id_item from cms_produttori inner join cms_produttori_lingue on cms_produttori.id=cms_produttori_lingue.id_cms_produttori where id_lingua=1 and abilitata='1' and ) order by titolo