Welcome Guest, Not a member yet? Register   Sign In
codeigniter 4.1.1 update +1 problem
#7

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);
$builder->where('id'2);
$builder->update();
// gives UPDATE mytable SET field = field+1 WHERE `id` = 2 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
codeigniter 4.1.1 update +1 problem - by amirodz - 05-19-2021, 05:49 AM
RE: codeigniter 4.1.1 update +1 problem - by includebeer - 05-20-2021, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB