Welcome Guest, Not a member yet? Register   Sign In
update('value', 'value' + 1)
#2

[eluser]Bramme[/eluser]
It's not working because you haven't read the manual properly.

Try
Code:
$this->db->update('mytable', array('value' => 'value + 1'));
Though that might get escaped and thus not executed right. You might have to use a full query.

Code:
$this->db->query("UPDATE mytable SET `value`=`value`+50 WHERE `id`="$userId");


Messages In This Thread
update('value', 'value' + 1) - by El Forum - 09-12-2008, 07:44 AM
update('value', 'value' + 1) - by El Forum - 09-12-2008, 07:50 AM
update('value', 'value' + 1) - by El Forum - 09-12-2008, 08:24 AM
update('value', 'value' + 1) - by El Forum - 09-12-2008, 08:34 AM
update('value', 'value' + 1) - by El Forum - 09-12-2008, 08:43 AM
update('value', 'value' + 1) - by El Forum - 09-25-2008, 03:00 PM
update('value', 'value' + 1) - by El Forum - 09-25-2008, 03:04 PM
update('value', 'value' + 1) - by El Forum - 09-25-2008, 08:09 PM
update('value', 'value' + 1) - by El Forum - 09-29-2008, 07:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB