【发布时间】:2013-02-27 21:29:51
【问题描述】:
有人可以告诉我,如果这可以通过活动记录实现 - 以及如何实现?
$this->db->select('*');
$this->db->from('table1');
$this->db->join('table2', 'table1.id = table2.fi_id', 'left');
$this->db->having('table1.second_id','table2.fi_second_id', false);
$query = $this->db->get();
问题在于,'table2.fi_second_id' 始终被视为 字符串 - 而不是 数据库字段。也用'where'试过这个 - 这是同样的问题。
谢谢
【问题讨论】:
-
为什么不使用
$this->db->query()的简单查询,它更灵活。
标签: php mysql codeigniter activerecord