SELECT * FROM JT_City WHERE (REPLACE(sCityName,'/ ','')='Davao City' AND iProvinceID =Davao Island ) OR (REPLACE(sCityName,'/',' ')='Davao City' AND iProvinceID =Davao Island);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 'Island ) OR (REPLACE(sCityName,'/',' ')='Davao City' AND iProvinceID =Davao Isl' at line 1