select count(bu_id), bu_type1, bu_type2 from bukken_sub where ( (bu_disp in ('', 1)) and ((bu_type1 = '2' and bu_type2 = '1') or (bu_type1 = '2' and bu_type2 = '2') or (bu_type1 = '1' and bu_type2 = '1') or (bu_type1 = '3' and bu_type2 = '2') or () or ()) and (bu_price < 50000000) and (bu_price >= 40000000) and ((concat(bu_address1, bu_address2) regexp 'ͻḫ')) and ( ( (1) and (bu_type1 = '2' and bu_type2 = '1') ) or ( (1) and (bu_type1 = '2' and bu_type2 = '2') ) or ( (1) and (bu_type1 = '1' and bu_type2 = '1') ) or ( (1) and (bu_type1 = '3' and bu_type2 = '2') ) or ( (1) and () ) or ( (1) and () ) ) ) group by bu_type1, bu_type2You 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 ()) and (bu_price < 50000000) and (bu_price >= 40000000) and ((concat(bu' at line 5