您好我在PHP中的SQL查询错误:
发生数据库错误
错误号码:1064
您的SQL语法有错误;检查与您的MariaDB服务器版本对应的手册,以便在第1行
') ORDER BY FIELD(qbank.qid, )'
附近使用正确的语法
SELECT qbank.*,question_category.* FROM qbank JOIN question_category ON qbank.cid = question_category.cid where qbank.institute_id = '1' and qid in () ORDER BY FIELD(qbank.qid, )
代码如下:
$query = $this -> db -> query("SELECT qbank.*,question_category.* FROM qbank JOIN question_category ON qbank.cid = question_category.cid where qbank.institute_id = '$institute_id' and qid in ($assignqids) ORDER BY FIELD(qbank.qid, $assignqids ) ");
$qidarr=$query->result_array();