Welcome Guest, Not a member yet? Register   Sign In
How to minus number in DB
#1

(This post was last modified: 01-08-2017, 09:39 AM by falcon812311. Edit Reason: change minus to subtraction, to easy understand )

PHP Code:
  function minus_set($id)
  {
    $this->db->trans_start();
    $this->db->set('total_set''total_set - 1');
    $this->db->set('price''price - 300.00');
    $this->db->where('user_id'$user_id);
    $this->db->update('users_detail'$data);
    $this->db->trans_complete();

    if ($this->db->trans_status() === TRUE)
    {
      return true;
    }
    else
    {
      return false;
    }
  
This is my model. I want subtract the total set and price. But, its not working.. how to fix it?
thanks
This is me. JK not me.
Reply


Messages In This Thread
How to minus number in DB - by falcon812311 - 01-08-2017, 05:11 AM
RE: How to minus number in DB - by Paradinight - 01-08-2017, 10:18 PM
RE: How to minus number in DB - by falcon812311 - 01-11-2017, 03:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB