我有一个来自 paypal 的 notification_url 脚本,该脚本应该使用以下代码更新我的数据库中的多个表:
//更新第一个表
$this->db->where('someid', $somid);
$this->db->update('表', $data);
///更新第二个表
$this->db->where('somesecondid', $somesecondid)
$this->db->update('anothertable', $data2);
然后我收到以下错误:“where 子句”中的未知列“somesecondid”
更新anothertable
SET avail
= 0 WHERE someid
= '13' AND somesecondid
= '199'
因此,codeigniter 将这些 where 子句合并到一个查询中。有没有办法取消设置第一个,使其只有“UPDATE anothertable SET Avail=0 WHERE somesecondid = 199”?谢谢!
最佳答案
您可能想在用户指南中了解 Active Record 缓存...
http://codeigniter.com/user_guide/database/active_record.html#caching
也许您的代码中较早的地方有“$this->db->start_cache()”。
关于mysql - Codeigniter 设置多个 where 条件,如何取消设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2822263/