更新activerecord中的所有记录 - codeigniter

Im trying to update all records in the DB, there is no key and no where clause.

But im getting an error saying I must specify a where clause.

    $data = array('views' => 0);
    $this->db->update_batch('table_places', $data); 

Simply using

$data = array('views' => 0);
$this->db->update('table_places', $data)

will update all the records in the table_places database for you.

update_batch() is used for updating multiple rows in your table with different data.