Welcome Guest, Not a member yet? Register   Sign In
$this->db->update('page', $data)->where -- Not working
#1

[eluser]EEssam[/eluser]
Hello,

Why method chaining is not working for me when trying to update? Is it only available for select statements?

http://ellislab.com/codeigniter/user-gui...tml#update

Please clarify.
#2

[eluser]mglinski[/eluser]
Your chaining in reverse.
Try this: $this->db->where('id, $id)->update(’page’, $data);

For Refrence: Any db command that inserts, updates or deletes data goes last in a chain, right before you retrieve the result of the query. This should be quite obvious but is often confused for the newbies.
-Matt
#3

[eluser]EEssam[/eluser]
Thanks, that worked.




Theme © iAndrew 2016 - Forum software by © MyBB