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

[eluser]ywftdg[/eluser]
Ahh ok, the group is basically saying for each result, group the reslts by sku, then totall em up ?

Now when I get this doing the first phase, I then have the second part. The skulist would be a list of items, which would contain things, that needs to be referenced in the next query. I guess now, my other big misunderstanding with models, is now how do I pass that skulist result, into the next query? Would I want to do the second query like this? I am still trying to wrap my head around how the best process/order is for all this.


Code:
//     grab products with skulists
        $this->db->select('pSku, pName, pCost, pPrice, pSkulist as skulist, sum(pPrice) as BaseBundlePrice, pPrice/sum(pPrice) as discount');
        $this->db->where("pSkulist <> ''");
        $this->db->from('products');
        $this->db->group_by('pSku');
        
// start the second query
        $this->db->select('pSku, pName, pCost, pPrice');
        $this->db->where("pSku in ($skulist)");
        $this->db->where('products.pDesignerId', $id);


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