Welcome Guest, Not a member yet? Register   Sign In
weird bug on database model [ci 1.6.2]
#6

[eluser]adwin[/eluser]
I found the problem but don't know which one is the error ... and i think it is not logic at all .. Sad
I found that the problem was caused by calculatetotal() function ... but that function dont have anything to do with db->ar_set()
Code:
function calculatetotal(){
            $measure = $this->mtconversions->get($this->measureid);
            $this->qty = $this->qty0 * $measure->value ;
            $total = ($this->qty * $this->unitprice) - $this->discount ;  
            $this->total = $total ;
            return $total ;
        }

        function save()
        {
            $this->calculatetotal();  

            $this->db->set('goodsid',$this->goodsid);
            $this->db->set('poid',$this->poid);
            $this->db->set('measureid',$this->measureid);
            $this->db->set('qty',$this->qty);
            $this->db->set('qty0',$this->qty0);
            $this->db->set('unitprice',$this->unitprice);
            $this->db->set('discount',$this->discount);
            $this->db->set('total', $this->total);
            // bug will be triggered the above with
            // $this->db->set('total', $this->calculatetotal());
            
            print_r($this->db->ar_set);
            return false;
        }

let me know if someone knows about this incident Big Grin.. i am still curious ...


Messages In This Thread
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 12:16 AM
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 12:33 AM
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 12:47 AM
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 12:49 AM
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 01:09 AM
weird bug on database model [ci 1.6.2] - by El Forum - 06-09-2008, 01:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB