如何使用活动记录更新多行?Codeigniter Active Record多更新
我的阵列
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
条款(id_customer和id_section)在2个参数,但如果我用update_batch
,我只能指定一个参数。 如何在WHERE
条款中设置几个参数?
在这个Q上的外观和A - http://stackoverflow.com/questions/7426094/codeigniter-批量更新与多个条件 – Sharif
使用多个'where'?像'$ this-> db-> where('id_section',$ id_section);''this-> db-> where('id_customer',$ id_customer);' – Bora