我正在进行CodeIgniter项目,我必须更改记录的状态。 实际上我只需要更新id为ids sting的记录。 p>
目前,我的代码只更新了一条记录。 我的模型函数是: p>
public function markUnRead(){
$ ids = 1,2,3,4,5,6;
$ update = array(' status'=> 0);
$ this-> db-> where_in('id',$ ids);
$ this-> db-> update('tableName',$ update);
if($ this-> db-> affected_rows()> 0){
return true;
} else {
return false;
}
}
code> pre>
请有人帮助我。 p>
div>