SELECT * FROM JT_City WHERE (REPLACE(sCityName,'/ ','')='Dhuni Kolhu Island' AND iProvinceID =Baa Atoll ) OR (REPLACE(sCityName,'/',' ')='Dhuni Kolhu Island' AND iProvinceID =Baa Atoll);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 'Atoll ) OR (REPLACE(sCityName,'/',' ')='Dhuni Kolhu Island' AND iProvinceID =Ba' at line 1