DB ERROR QUERY ( SELECT distinct (p.property_id) as PROPERTYID, c.symbol AS currency, p.name as `NAME`, p.n_bedrooms as NBEDROOMS, p.n_sleeps as NSLEEPS, p.highlights as HIGHLIGHTS, p.area as AREA, p.description_title as DESCTITLE, pt.name as PROPERTYTYPE, lt.name as LOCATIONTYPE, aty.name as ACCOMODATIONTYPE FROM bul_property p LEFT JOIN bul_property_type pt ON p.property_type = pt.property_type_id LEFT JOIN bul_location_type lt ON p.location_type = lt.location_type_id LEFT JOIN bul_accomodation_type aty ON p.accomodation_type = aty.accomodation_type_id LEFT JOIN bul_rel_theme rel_th ON p.property_id = rel_th.property_id LEFT JOIN bul_rel_general rel_gen ON p.property_id = rel_gen.property_id LEFT JOIN bul_rel_entertainment rel_en ON p.property_id = rel_en.property_id LEFT JOIN bul_currency c ON c.currency_id=p.currency WHERE p.property_status<>3(p.name like '%beach%' or p.highlights like '%beach%' or p.kitchen like '%beach%' or p.living_room like '%beach%' or p.dining like '%beach%' or p.bathrooms like '%beach%' or p.bedrooms like '%beach%' or p.outside like '%beach%' or p.swim_pool like '%beach%' or p.suitability like '%beach%' or p.notes like '%beach%' or p.description like '%beach%' or p.description_title like '%beach%' or p.location like '%beach%' or p.airport like '%beach%' or p.beach like '%beach%' or p.motorway like '%beach%' or p.ferry like '%beach%' or p.rail like '%beach%' or pt.name like '%beach%' or lt.name like '%beach%' or aty.name like '%beach%') and ) -> 1064: 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 '(p.name like '%beach%' or p.highlights like '%beach%' or p.kitchen like '%beach%' at line 1