update in codeigniter works but displays an error message
- by Charmie
i was just wondering what could be the problem with a working code yet displays an error message such as this:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: database/DB_active_rec.php
Line Number: 1407
im trying to update fields in my database. I have this code and every tutorial are just the same for batch upload. It works anyway but the thing is it display such an error.
this what i have in my model:
function update2($data){
$this->db->update_batch('users',$data, "id");
}
This what i have in my controller:
public function updateValues(){
$this->load->model('get_db');
$newRow = array(
array(
'id' => '3',
'firstname' => 'Rapphie'
),
array(
'id' => '2',
'firstname' => 'Charmie'
)
);
$this->get_db->update2($newRow);
echo "it has been updated";
}
please help.