• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$this->db->update('page', $data)->where -- Not working


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


Please clarify.

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.

Thanks, that worked.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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