Problem updating.

#1
[eluser]Unknown[/eluser]
I have the following table

id
nombre
email
username
password

and I have the following model

Code:
public function editarUsuario($id, $data) {
        $this->db->where('id', $id);
        $this->db->update('usuarios', $data);
    }

The problem is that when I save in the database, it tells me:

Quote:Error Number: 1054

Unknown column '0' in 'field list'

UPDATE `usuarios` SET `0` = '5', `1` = 'nicolas', `2` = 'mail@mail.com', `3` = 'usuario', `4` = '123' WHERE `id` = '5'

Filename: /home/nicolas/public_html/CodeIgniter/models/usuario_model.php

Line Number: 83

The data is correct, but not the names of the columns

#2
[eluser]ivantcholakov[/eluser]
Is your data really an associative massive?

var_dump($data);

#3
[eluser]Tpojka[/eluser]
I am seeing numbers here so maybe that letter 'o' should be number zero '0'.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.