【发布时间】:2013-08-01 14:25:04
【问题描述】:
如何使用活动记录更新多行?
我的数组
foreach($services as $service){
$this->service_batch[]=array(
'service_id'=>$service->service_id,
'service_count'=>$service->service_count,
'id_customer'=>$service->id_customer,
'id_section'=>$service->id_section);
}
当我更新表格时,我需要在WHERE 子句中定义2 个参数(id_customer AND id_section),但如果我使用update_batch,我只能指定一个参数。
如何在WHERE子句中设置几个参数?
【问题讨论】:
-
使用多个
where?喜欢$this->db->where('id_section', $id_section);$this->db->where('id_customer', $id_customer);
标签: php codeigniter activerecord