select n.id_navigation from spe_dossier_navigation dn, spe_navigation n where dn.id_navigation=n.id_navigation and dn.id_dossier = and n.id_navigation_menu=234; : 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 n.id_navigation_menu=234' at line 3