|
发表于 2010-7-9 17:48:29
|
显示全部楼层
方法1:
$this->db->get_where('test','a=1 or (b=1 and c=1)');
方法2:
$this->db->or_where('a=1',NULL,FALSE);
$this->db->or_where('(b=1 and c=1)',NULL,FALSE);
$this->db->get('test');
方法3:
$this->db->where('id=1 or (id=1 and id=1)',NULL,FALSE);
$this->db->get('test');
应该还有其他方法,有兴趣自己研究吧
CI很灵活提供了很大的弹性,包括但不局限于AR,绝大多数情况下肯定有一种能满足你的要求 |
评分
-
查看全部评分
|