Welcome Guest, Not a member yet? Register   Sign In
Active Record: WHERE(.. OR ..) AND ..
#1

[eluser]Buso[/eluser]
I need this:

Code:
SELECT * FROM table WHERE id = ? AND (status = ? OR ip = ?);

Is it possible to do it with active record?

This is what I have so far:

Code:
$this->db->where('id',$id);
$this->db->where('status',$status);
$this->db->or_where('ip',$ip);

But it's not the same


Messages In This Thread
Active Record: WHERE(.. OR ..) AND .. - by El Forum - 11-10-2009, 12:03 PM
Active Record: WHERE(.. OR ..) AND .. - by El Forum - 11-10-2009, 03:14 PM
Active Record: WHERE(.. OR ..) AND .. - by El Forum - 11-10-2009, 03:39 PM
Active Record: WHERE(.. OR ..) AND .. - by El Forum - 11-10-2009, 03:39 PM
Active Record: WHERE(.. OR ..) AND .. - by El Forum - 11-10-2009, 03:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB