Php 从两个表和两个要显示的值左加入codeigniter

Php 从两个表和两个要显示的值左加入codeigniter,php,sql,codeigniter,Php,Sql,Codeigniter,表1包含计时计划,表2包含类别名称。我需要类别名称和时间来显示带有左联接的两个表中的id,这是怎么可能的?尝试下面的查询 select * from table1 left join table2 on table1.id=table2.id 在词中 使用此代码,这将有助于从两个表中获取数据,并从两个表中获取两个值: db schema?。请提供全部详情 $this->db->select('*'); $this->db->from('table1'); $this-&

表1包含计时计划,表2包含类别名称。我需要类别名称和时间来显示带有左联接的两个表中的id,这是怎么可能的?

尝试下面的查询

select * from table1 left join table2 on table1.id=table2.id
在词中

使用此代码,这将有助于从两个表中获取数据,并从两个表中获取两个值:

db schema?。请提供全部详情
$this->db->select('*');
$this->db->from('table1');
$this->db->join('table2 ', 'table1.id=table2.id', 'left');
$query = $this->db->get();
Use this code which will help to get the data from the two tables and getting the two values from both the tables:
<?PHP
 $this->db->select('t1.name, t2.desc')
 ->from('table_first as t1')
 ->where('t1.id', $id)
 ->join('table_second as t2', 't1.id = t2.id', 'LEFT')
 ->get();
?>