select a.dealer_seq, b.* from tbl_product_category_dealer_mapping a, tbl_dealer b where b.seq = a.dealer_seq and p_seq = and category_detail_seq = 8 and offline_yn = 1 and (address1 like '%%' or address2 like '%%' or old_address1 like '%%' or old_address2 like '%%') order by name limit 1

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 'and category_detail_seq = 8 and offline_yn = 1 and (address1 like '%%' or add' at line 5

error file : /page/ajax/ajax_maps_search.php