Welcome Guest, Not a member yet? Register   Sign In
How to get data from 2 related tables in the same controller?
#4

(07-09-2019, 11:50 PM)neuron Wrote:
PHP Code:
$this->db->select('d.*, o.*')
->
from('departments d')
->
join('occupations o''o.department_id = d.department_id''LEFT'


Simple join it is all you have to do, and you should learn JOIN clause in SQL.

Thank you both for the replies. It worked perfectly
Reply


Messages In This Thread
RE: How to get data from 2 related tables in the same controller? - by dragoshjianu - 07-11-2019, 11:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB