CodeIgniter Forums
$this->db->update() not working for me - 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: $this->db->update() not working for me (/showthread.php?tid=22429)



$this->db->update() not working for me - El Forum - 09-09-2009

[eluser]Robert May[/eluser]
No idea why, but this query doesn't work (nor does any alteration on it using set() or where()). If you replace update() with insert() it works more as you would expect.

$this->db->update(self::MODEL_TABLE, array('retrieved' => 1), array('id' => $entry->id));

Any ideas as to what's wrong?


$this->db->update() not working for me - El Forum - 09-09-2009

[eluser]überfuzz[/eluser]
[quote author="Robert May" date="1252526815"]No idea why, but this query doesn't work (nor does any alteration on it using set() or where()). If you replace update() with insert() it works more as you would expect.

$this->db->update(self::MODEL_TABLE, array('retrieved' => 1), array('id' => $entry->id));

Any ideas as to what's wrong?[/quote]
Hard to say without seing the MySQL string, but you might wanna read up on WHERE.