try this out….(normal mysql)
SELECT t1.*,t2.image FROM table1 t1
LEFT JOIN table2 t2 on t1.house_id=t2.house_id
WHERE t1.status= 1 GROUP BY t1.house_id ORDER BY house_id desc
active record…
$this->db->select(t1.*,t2.image);
$this->db->from('table1'.' t1');
$this->db->join('table2'.' t2','t1.house_id=t2.house_id','left');
$this->db->where('t1.status',1);
$this->db->group_by("t1.house_id");
$this->db->order_by("house_id");
6
solved mysql , codeigniter active record class [closed]