Cannot update database fields using model->save() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Cannot update database fields using model->save() (/showthread.php?tid=78168) |
Cannot update database fields using model->save() - [email protected] - 12-08-2020 Hi guys, So I'm working on a CodeIgniter school project and I got stuck while trying to update the user profile. I cannot for the life of me figure out why model->save() does nothing in the db and model->replace works BUT my password isn't hashed before updating the db field with the new password. This is my controller function called "profile". PHP Code: public function profile() PHP Code: <?php The view file Code: <div class="container"> Any help is greatly apreciated. RE: Cannot update database fields using model->save() - InsiteFX - 12-08-2020 Did you try using set on the data array? PHP Code: $model->set($newData); If that wont work then you have problems else where in your code. RE: Cannot update database fields using model->save() - [email protected] - 12-14-2020 The problem was a typo in my Model. I wrote primarykey instead of primaryKey... |