Welcome Guest, Not a member yet? Register   Sign In
Update a column. column - value?
#1

[eluser]JasonS[/eluser]
I just want to subtract from a database column.

total=total-'$amount'

Do I need to write a custom query to do this or can I do it with Active Record?
#2

[eluser]xwero[/eluser]
Code:
$this->db->set('total','total-'.$amount,false)
#3

[eluser]JasonS[/eluser]
Ah thank you very much.




Theme © iAndrew 2016 - Forum software by © MyBB