简体   繁体   English

使用多个WHERE子句更新Codeigniter中的批处理

[英]Update Batch in Codeigniter with multiple WHERE clause

I checked the CI user guide to see how to handle update_batch() and it seems it accept onlt one index to match which row to be updated. 我检查了CI用户指南,看看如何处理update_batch() ,它似乎接受一个索引来匹配要更新的行。

But in my instance, i need to specify two index like lang and id_page which i use as index together. 但在我的实例中,我需要指定两个索引,如langid_page ,我将它们一起用作索引。 such lang=en|id_page=115 is unique so the key for the row. 这样的lang=en|id_page=115是唯一的,因此该行的键。

Means, my where index should be WHERE lang = $lang AND id_page = $id_page ... 意思是,我的索引应该是WHERE lang = $lang AND id_page = $id_page ...

Is there any approach on batch update with multiple index? 有多个索引的批量更新有什么方法吗?

Thank you. 谢谢。

There is not at the moment. 目前还没有。 You could write a new driver that extends one of the existing ones but it is probably not worth it. 您可以编写一个新的驱动程序来扩展现有的驱动程序,但它可能不值得。 What exactly are you trying to do? 你究竟想做什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM