Welcome Guest, Not a member yet? Register   Sign In
Join Question
#2

[eluser]garymardell[/eluser]
Code:
$this->db->select('users.*, users2cats.cat_id, cats.name AS cat, COUNT(users.id) as user_count');
$this->db->from('users');
$this->db->join('users2cats', 'users.id = users2cats.user_id');
$this->db->join('cats', 'users2cats.cat_id = cats.id');
$this->db->group_by("cats.id");

May work.


Messages In This Thread
Join Question - by El Forum - 07-05-2009, 05:19 PM
Join Question - by El Forum - 07-05-2009, 06:21 PM
Join Question - by El Forum - 07-05-2009, 06:31 PM
Join Question - by El Forum - 07-05-2009, 08:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB