mysql - Codeigniter Data Retrieve -


here database structure database

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??

01

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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -