![]() |
Active record Update issue - 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: Active record Update issue (/showthread.php?tid=8890) |
Active record Update issue - El Forum - 06-04-2008 [eluser]chinedubond[/eluser] please i keep getting an error with my code below. i am trying to update a table. i believe i am doing everything ok. please help. Code: $array = array('timeregistered' => $timereg, 'password' => $password); Code: Fatal error: Call to a member function num_rows() on a non-object in D:\dumps\opensource\projects\nightengale\bizlocator\system\application\models\users\usersmodel.php on line 34 Active record Update issue - El Forum - 06-04-2008 [eluser]mironcho[/eluser] Hi chinedubond, update method doesn't return query object. You can use affected_rows() method instead: Code: if ($this->db->affected_rows() > 0) Active record Update issue - El Forum - 06-04-2008 [eluser]m4rw3r[/eluser] db::update() returns true/false depending on if the query succeeds or not. Use db->affected_rows() to find how many rows that were altered. EDIT: to slow ![]() |