[eluser]cmh24[/eluser]
I have to tables filled with data (see below).
id | org_id | com_id
1 6 2
2 6 3
3 7 2
4 7 4
id | company
1 Ford
2 GM
3 Chrysler
4 Toyota
And now I show you what I want to get. You have to think from the perspective of organizer 6(org_id). (com_id =company id)
id | company | is_registered
1 Ford NO
2 GM YES
3 Chrysler YES
4 Toyota NO
Code:
$query = $this->db->select('*')
->from('companies')
->join('org_com','companies.id = org_com.com_id')
->where('org_id', $this->session->userdata('user_id'))
->get();
But this one only gives me back the ones that are registered and not not the other ones.
Thanks for your help!
Max