Welcome Guest, Not a member yet? Register   Sign In
ActiveRecord class question
#1

[eluser]i_am_using_ci[/eluser]
Hi, I wanted to ask is there any way to do query like:
Code:
update table set field = filed + 1 where id = 1
with ActiveRecord class?

I am always getting
Code:
update table set field = 'field + 1' where id = 1

when doing:
Code:
$this->db->where('id', 1);
$this->db->update('table', array('checks' = 'checks + 1'));
#2

[eluser]Dam1an[/eluser]
See the part on set in the AR user guide
Set accepts a 3rd parameter to prevent escaping things like this
#3

[eluser]i_am_using_ci[/eluser]
Thanks! Smile




Theme © iAndrew 2016 - Forum software by © MyBB