You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1: SELECT key_id,key_city_id,key_qh_id FROM keyword WHERE `key_name` = '' AND `key_cate_id` = 0 AND `key_city_id` != 0 AND `key_qh_id` != 0 AND `key_cb_id` = 0 AND key_qh_id IN ()