Can not execute query : SELECT * FROM `csp_athlete_img` WHERE `event_id`='' AND `bid_no` = OR (`event_id`='' AND img_type='S') ORDER BY `bid_no`. Error : 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 'OR (`event_id`='' AND img_type='S') ORDER BY `bid_no`' at line 1 1064