В этом запросе я объединил только одну таблицу; как мне присоединиться к моему 3-му, 4-му столу?
Код: Выделить всё
$this->db->select('*');
$this->db->from('table1');
$this->db->join('table1', 'table1.dep_id = table2.dep_id', 'table1.status= 1');
$this->db->limit(1);
$this->db->order_by("expiredate", "desc");
return $this->db->get()->result();
Таблица1
Код: Выделить всё
t1_id
t1_name
t2_id
t3_id
t4_id
Код: Выделить всё
t2_id
t2_name
Код: Выделить всё
t3_id
t3_name
Код: Выделить всё
t4_id
t4_name
Мобильная версия