$this->db->upda_string() don't upadte the row |
[eluser]atoleon[/eluser]
Hi I've got a code to update a row in my database but the code don't write on it. This is the code im using and i cant see the error. Code: $datos_usuario = array (
[eluser]WanWizard[/eluser]
error message? What is the result of Code: echo $this->db->last_query();
[eluser]ShoKatoo[/eluser]
Try this: Code: $where = array('id_usuario' => '1'); Have Phun!
[eluser]atoleon[/eluser]
[quote author="WanWizard" date="1288040155"]error message? What is the result of Code: echo $this->db->last_query(); the result of $this->db->last_query()is empty. It's like the query wasnt executed. However echo $query return UPDATE `usuarios` SET `nombre` = 'Antonio Juan', `apellidos` = 'sv', `nif` = '', `direccion` = '', `email` = '[email protected]', `telefono` = '' WHERE id_usuario = 1 And if i execute this in my phpmyadmin, the row is updates. Then, the problem must be the query is not executed in the code. But the code seems good.
[eluser]WanWizard[/eluser]
I've never used this helper, so I looked it up in the manual. That clearly states: Quote:This function simplifies the process of writing database updates. It returns a correctly formatted SQL update string. So it is absolutely correct that it doesn't execute anything, it just generates the SQL. Why don't you use active record instead? Code: $this->db->where('id_usuario', '1'); |
Welcome Guest, Not a member yet? Register Sign In |