Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I need a query that looks like:

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

and I have tried

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

with various means of where or_where get_where and no luck forming a query similar to the above need was hoping someone could shed some light for me on the subject

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I think You can do that by using something like

$this->db->select()->from(MEMB_EVENTS);
$this->db->where('mID', $mID);
$this->db->where("(eid='1' OR eid='2' OR eid='10')", NULL, FALSE);
share|improve this answer
    
That worked better than I had hoped, appreciate it –  chris Apr 28 '13 at 23:32
    
@chris you welcome man! –  Fabio Apr 29 '13 at 5:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.