mysql - Codeigniter Data Retrieve -
same subject may have many teachers. first database teacher field foreign database. when searching individual subject how full teacher details.
try this
select * subject full outer join teachers on subject.teacher = teachers.id subject.subject '$search';
why full outer join??
how in ci?
$query = $this->db->query("select * subject full outer join teachers on subject.teacher = teachers.id subject.subject '$search' "); $result = $query->result_array(); return $result;
Comments
Post a Comment