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 '0' and annuncio_cat1 = id_cat1 and annuncio_cat2 = id_cat2 and annuncio_id != 12' at line 3