update in codeigniter works but displays an error message

Posted by Charmie on Stack Overflow See other posts from Stack Overflow or by Charmie
Published on 2012-07-01T03:08:16Z Indexed on 2012/07/01 3:15 UTC
Read the original article Hit count: 134

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql