我想做一个像这样的sql查询
select * where x = 10 and (y=12 or h=15)
如何以 CI ActiveRecord 格式实现这一点?
最佳答案
参见Active record引用
$where="x = 10 and (y=12 or h=15)";
$this->db->select('*');
$this->db->from('mytable');
$this->db->where($where);
$query = $this->db->get();
关于php - CI ActiveRecord 中的组合条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18099990/