|
请问如何在批量更新中使用feild=feild+1这样的功能呢?
单个的update,可以
$this->db->set('count', 'count+1', FALSE);
$this->db->update('vote20150116');
批量的,如何设置呢:
我试了,这样子的,不行:
$vote=array(
array(
'id'=>$one,
'count'=>'count+1'
),
array(
'id'=>$two,
'count'=>'count+1'
),
array(
'id'=>$three,
'count'=>'count+1'
)
);
$this->db->update_batch('vote20150211', $vote, 'id');
}
|
|