![]() |
my model does not work as expected - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: my model does not work as expected (/showthread.php?tid=76932) |
my model does not work as expected - Ahmad Ali - 07-04-2020 Hi, I have a users table in the database the problem is when I want to update a selected row in the table using save or update function it does not update. I don't know why but I'm sure that the code is fine. Below is the function that updates the selected row. PHP Code: public function edit_profile() PHP Code: <?php RE: my model does not work as expected - marcogmonteiro - 07-05-2020 Your password field is required but you're not setting a password when you call the save method. If you print the model errors after the save method you'll be able to see that. RE: my model does not work as expected - IvanGlickman - 04-15-2021 (07-05-2020, 10:50 AM)marcogmonteiro Wrote: Your password field is required but you're not setting a password when you call the save method. If you print the model errors after the save method you'll be able to see that buy.Thank you! I see how it works now. RE: my model does not work as expected - Codinglander - 04-15-2021 You can also use this: http://codeigniter.com/user_guide/models/model.html#protecting-fields For updating data this works perfectly, too. |