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 '' at line 1 SELECT * FROM domaines,vins,cuvees WHERE domaines.domaines_id=20 AND domaines.domaines_id=vins.id_domaine AND cuvees.cuvees_id=vins.id_cuvee AND vins.id_couleur=1 AND vins.vins_extra IS NULL AND vins.id_cuvee=