SELECT CST.id_thematique, CT.nom FROM chut_spectacle_thematique AS CST, chut_thematique AS CT WHERE CST.id_spectacle= AND CST.id_thematique=CT.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 CST.id_thematique=CT.id' at line 1