Welcome Guest, Not a member yet? Register   Sign In
Add subquery to main query result instead of running lots of foreachs
#2

[eluser]JoostV[/eluser]
You have every right to be worried about performance Smile

I reckon a join query here would solve the problem.

Code:
$this->db->from('discs');
$this->db->join('songs', 'discs.id = songs.disc_id', 'left');
$this->db->join('versions', 'songs.id = versions.song_id', 'left');
$this->db->where(discs.id, 1);
$versions = $this->db->get();


Messages In This Thread
Add subquery to main query result instead of running lots of foreachs - by El Forum - 08-20-2010, 05:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB