繁体   English   中英

codeigniter活动记录数据库查询

[英]codeigniter active record db query

我需要一个看起来像这样的查询:

select * from table where id=5 and (eid = 1 or eid = 2 or eid = 10)

我试过了

$this->db->select()->from(MEMB_EVENTS);
$this->db->where('mID', $mID);

用各种手段where or_where get_where并没有运气形成类似上述需要希望有人能对受一些启发,我查询

我想你可以通过使用像这样的东西来做到这一点

$this->db->select()->from(MEMB_EVENTS);
$this->db->where('mID', $mID);
$this->db->where("(eid='1' OR eid='2' OR eid='10')", NULL, FALSE);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM