[eluser]betoranaldi[/eluser]
I am familiar with mysql queries but new to joins and ActiveRecord.
I am trying to join 3 tables. I can get two of them to join without a problem but once I join the third, it returns no results (from what I can see.)
Code:
$this->db->select('*');
$this->db->from('jobs');
$this->db->join('requestors', 'requestors.id = jobs.requestor');
$this->db->where('jobs.assigned', $this->session->userdata('user_id'));
$this->db->limit(10, $os);
$data ['query'] = $this->db->get();
This returns all rows assigned to a specific user and gives me access to the first name/last name columns of the requestors table.
Now when I add the join to the flow table (to replace numbers found in the flow column of the jobs table) something breaks and I get no results. I don't get any php or mysql warnings.
Code:
$this->db->select('*');
$this->db->from('jobs');
$this->db->join('requestors', 'requestors.id = jobs.requestor');
$this->db->join('flow', 'flow.id = jobs.flow');
$this->db->where('jobs.assigned', $this->session->userdata('user_id'));
$this->db->limit(10, $os);
$data ['query'] = $this->db->get();
What am I missing or doing wrong? Is there any resource for CI and ActiveRecord Joins?
Thanks
Brian