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 S Q L =select * from bigevents where bigevents_status='A' and bigevents_dob >='2008-11-19' and bigevents_city_id=1 and bigevents_id!=