我有查询= SELECT @condi:=id FROM table WHERE id>1 LIMIT 1 for UPDATE; UPDATE table set aa="ok" WHERE id=@condi
我用 $this->db->query(query)
但是codeigniter信息错误"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 'update table set aa="确定" where id=@condi' at line 1"小姐";"我用phpmyadmin执行这个查询,它的结果行正确没有错误查询
也许核心codeigniter错误你能帮我在codeigniter中执行我的查询,谢谢
1 回答
您可以尝试使用查询构建器来防止SQL错误:
因为Codeigniter 3构建器不支持
FOR UPDATE
,所以我只使用编译器来重建查询 .