Welcome Guest, Not a member yet? Register   Sign In
Mysql Queries - Best Tips
#2

[eluser]Armchair Samurai[/eluser]
Assuming there is a 1-to-1 relationship between the tables, just join them rather than making three separate queries.
Code:
$this->db->join('accounts y', 'x.author_id = y.id');
$this->db->join('posts_categories z', 'x.cat_id = z.post_id');
$query = $this->db->get('blogs x');
return $query->result_array();


Messages In This Thread
Mysql Queries - Best Tips - by El Forum - 06-17-2008, 02:17 PM
Mysql Queries - Best Tips - by El Forum - 06-17-2008, 06:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB