Welcome Guest, Not a member yet? Register   Sign In
Incrementing DB values
#1

Is there a way in CI4 to increment a value in a database in one query?

I would like to be able to do something like:

Code:
UPDATE table set field = field+5 where some_condition

I know I can do this:

PHP Code:
$db->query('UPDATE table set field = field+5 where some_condition'); 

I am just wondering if there is a way to do it without having to write the query myself.
Reply


Messages In This Thread
Incrementing DB values - by Derek - 11-12-2020, 04:54 PM
RE: Incrementing DB values - by InsiteFX - 11-13-2020, 01:20 PM
RE: Incrementing DB values - by wdeda - 11-13-2020, 03:20 PM
RE: Incrementing DB values - by Derek - 05-14-2021, 09:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB