[eluser]Todlerone[/eluser]
Hello all and TY in advance. How do you join three tables together in a query? I have three tables: schedule, demographics and treatments. I want to join several rows from the schedule and demographics tables to the treatment table.
From model
Code:
function display_planning(){
$this->db->select('*');
$this->db->from('demographics');
$this->db->join('treatments','demographics.demo_NumID = treatments.demo_NumID');
$query = $this->db->get();
return $query->result_array();
}
from controller
Code:
$data['planning'] = $this->Patients->display_planning();
Not sure how to put the query and join in from my schedule table.
CHEERS