CodeIgniter Forums
db->update error: You must use the "set" method to update an entry. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: db->update error: You must use the "set" method to update an entry. (/showthread.php?tid=35712)



db->update error: You must use the "set" method to update an entry. - El Forum - 11-09-2010

[eluser]stormbytes[/eluser]
I'm trying to update an entry in a database using:

Code:
$row = array('id' => '5', 'name' => 'john');

$this->db->where('id', '5');
$this->db->update($row);

And it's returning this error:

You must use the "set" method to update an entry.


db->update error: You must use the "set" method to update an entry. - El Forum - 11-09-2010

[eluser]stormbytes[/eluser]
Bah! Forgot the table name in the update stmt. I need to stop working so late!


db->update error: You must use the "set" method to update an entry. - El Forum - 11-09-2010

[eluser]wiredesignz[/eluser]
Yeah, you do! Smile