I am working on a CodeIgniter project where i have to change the status of record. Actually I have to update only those records whose id are/is in the ids sting.
Currently, only one record is updated with my code. My model function is:
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;
}
}
Someone help me please.