2013-04-28 148 views
0

我需要一个查询,看起来像:笨活动记录数据库查询

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); 

whereor_whereget_where各种手段和没有运气形成类似查询上面的需求是希望有人能为我在这个问题上发光

回答

2

我想你可以通过使用somethi ng像

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

这工作比我希望的更好,欣赏它 – chris 2013-04-28 23:32:06

+0

@chris你欢迎男人! – Fabio 2013-04-29 05:31:17