Welcome Guest, Not a member yet? Register   Sign In
update function
#1

[eluser]vishok[/eluser]
i'd like to update a table but i have few problem.

i made this but not function

$fields = $this->db->list_fields($this->tbl);
$data = array();
foreach ($fields as $field) {
$this->object_custom->chiave = $field;
$this->object_custom->valore = $this->input->post($field);
array_push ($data,$this->object_custom);
}
$this->db->update($this->tbl, $data);
#2

[eluser]InsiteFX[/eluser]
You need to tell it where to update!
Code:
$this->db->where('id', $id);

InsiteFX
#3

[eluser]vishok[/eluser]
yes i know, but this is not my problem.

my variable data is an array of array of object
and to make update i need an array of object.

I'm sorry but my english is not so fine.

I hope you understand what i mean.




Theme © iAndrew 2016 - Forum software by © MyBB