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 '=link_link_link' at line 1 while executing SELECT ap_id, ap_street_en, ap_metro_en, ap_price, ap_allsquare, ap_rooms, ap_webtext_en, ap_map_val FROM apt_ap WHERE ap_id=link_link_link