我在CodeIgniter上的活动记录更新批处理中遇到问题。
在文件上,
$this->db->update_batch('mytable', $data, 'title');
其中“title”是更新过程的索引。是否可以对此活动记录使用两个或多个索引?我已经尝试过了
$this->db->update_batch('mytable', $data, 'title, title_2');
$this->db->update_batch('mytable', $data, array('title', 'title_2');
但没有用。
1条答案
按热度按时间vcudknz31#
您可以在
update_batch
之前再提供一个where
:然后,这将为
update_batch
查询提供额外的WHERE
:但是,
update_batch
会在每次更新时内部重置WHERE
子句。因此,作为一种解决方案,您可以事先将其分块,以确保WHERE
在每次迭代时应用: