我一直在环顾四周,但我还没有找到答案。如果你知道答案,请帮助。在Codeigniter中更新多行
如何更新CI中的多行?
在我的MySQL:
我有列名:
ID, Settings Name, Settings Value (Settings Name is Unique)
我有FF数据:
ID = 1, Settings Name = "Hello" , Settings Value = "True"
ID = 2, Settings Name = "World", Settings Value = "Good"
更多...
我也有一个表格获得Settings Value
,但我不确定如何在数据库上进行更新。如何更新True
为Hello
为Settings Name
并更新Good
为World
。
我听说过insert_batch()
,但是有没有update_batch()
?
我觉得一个关联数组,它可以帮助你 http://stackoverflow.com/questions/7759514/update-multiple-rows -with-different-values-in-a-single-query-mysql –