Welcome Guest, Not a member yet? Register   Sign In
Solved : Newbie question - Working with models
#3

[eluser]ywftdg[/eluser]
Thanks xwero, I rewrote the item to this like, which returned correctly, and is much cleaner:

Code:
function get_bundlestats($id,$datepost)    {
    
        $this->db->select('pSku, pName, pCost, pPrice, pSkulist');    //     grab products with skulists
        $this->db->where("pSkulist <> ''");
        $this->db->from('products');

        $this->db->group_by('pSku,pSku'); //group the items, using same reference for both

        $this->db->select('sum(pPrice) as BaseBundlePrice');
        $this->db->from('products');
    
    
        $querybundle = $this->db->get();
        return $querybundle->result();
        
       }

I am assuming, there is no need (at least in my case) to be doing the if statement, right? Because, the full query is necessary to return any value what so ever. Basically, there is no else case in my query.


Messages In This Thread
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 12:26 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 12:45 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 01:00 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 01:12 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 01:20 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 01:33 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 01:43 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 02:08 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 02:15 AM
Solved : Newbie question - Working with models - by El Forum - 08-11-2008, 03:39 AM
Solved : Newbie question - Working with models - by El Forum - 08-12-2008, 12:15 AM
Solved : Newbie question - Working with models - by El Forum - 08-12-2008, 01:45 AM
Solved : Newbie question - Working with models - by El Forum - 08-12-2008, 11:44 PM
Solved : Newbie question - Working with models - by El Forum - 08-13-2008, 07:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB