【发布时间】:2013-03-20 23:19:27
【问题描述】:
只想在 CODEIGNITER 中加入 1 到 3 个表,怎么做
在这个查询中,我只加入了一个表,我如何加入我的第三、第四个表
$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
表2
t2_id
t2_name
表3
t3_id
t3_name
table4
t4_id
t4_name
我怎样才能加入我的第三和第四次
提前问好……
【问题讨论】:
-
另一个
join电话呢? -
不适用于此
-
@rafiq 简要解释或给出你的表结构
标签: php mysql codeigniter