【发布时间】:2016-01-25 21:56:37
【问题描述】:
我正在使用带有 activerecord 的 CodeIgniter 来访问我的数据库, 我想知道是否要编写这样的查询:
Select * from table1, table2
whher table1.id = table2.id
我试过了:
$where = array("table1.id" => "table2.id");
$query = $this->db->get_where("table1, table2" , $where);
return $query->result();
但它给了我一个错误,因为它编译为:
select * from table1, table2
where table1.id = 'table2.id'
那么如何判断我想要一个列等于 codeIgniter 中 activerecord 中的另一列?
谢谢
【问题讨论】:
标签: php sql codeigniter activerecord