Query fallita SELECT categorie.id FROM categorie, rel_cat_sottocat WHERE rel_cat_sottocat.id_sottocat = AND rel_cat_sottocat.id_cat = categorie.id: 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 rel_cat_sottocat.id_cat = categorie.id' at line 1