Welcome Guest, Not a member yet? Register   Sign In
Problem with update data (reduce value)
#1

[eluser]Carmichael[/eluser]
Code:
function reduce_credits($id, $credits)
   {
        $this->db->where('user_id', $id);
        $this->db->update($this->user_table, 'user_credits = user_credits - '.$credits.'');
   }

When I run that function it updates the user_credits column to 0 insted of reduce the current value. Why?



Messages In This Thread
Problem with update data (reduce value) - by El Forum - 04-07-2012, 03:52 PM
Problem with update data (reduce value) - by El Forum - 04-07-2012, 04:18 PM
Problem with update data (reduce value) - by El Forum - 04-07-2012, 04:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB