• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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