codeigniter 4.1.1 update +1 problem |
1. See the manual for how the update is performed.
https://codeigniter.com/user_guide/model...-with-data 2. For increment, you can use increment() method https://codeigniter.com/user_guide/datab...#increment
$AlertModel->set('read', 'read+1',false);
$AlertModel->where('id',$id); $AlertModel->update(); 4.1.2 do not work It looks like there is a real problem
Problem is your doing it wrong.
Did you even read the CodeIgniter Users Guide on the update method like @iRedds explained to you even gave you the links? PHP Code: // update method call I would sit down and read those to links very carefully. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
There's an example in the user guide almost identical to your code. But they are using the Query Builder functions. The Model class also call the query builder, so I'm not sure why it was not working for you.
From https://codeigniter.com/user_guide/datab...ating-data PHP Code: $builder->set('field', 'field+1', false);
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |