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 'and abilitata='1' and abilitata=1 and id_hotel= order by data_inserimento desc l' at line 1select *, cms_offerte.id as id_item from cms_offerte inner join cms_offerte_lingue on cms_offerte.id=cms_offerte_lingue.id_cms_offerte where id_lingua= and abilitata='1' and abilitata=1 and id_hotel= order by data_inserimento desc limit ,