Welcome Guest, Not a member yet? Register   Sign In
How would you write given query using active record
#3

[eluser]smilie[/eluser]
Although I do agree with Dennis (using AR for 'simple' queries), I think AR could do this as well with: or_where:

Quote:$this->db->or_where();

This function is identical to the one above, except that multiple instances are joined by OR:

$this->db->where('name !=', $name);
$this->db->or_where('id >', $id);

// Produces: WHERE name != 'Joe' OR id > 50
Note: or_where() was formerly known as orwhere(), which has been deprecated.

See: http://ellislab.com/codeigniter/user-gui...tml#select (and then a bit bellow on that page).

So, it should be doable Smile

Cheers,
Smilie


Messages In This Thread
How would you write given query using active record - by El Forum - 01-05-2011, 08:02 AM
How would you write given query using active record - by El Forum - 01-05-2011, 08:40 AM
How would you write given query using active record - by El Forum - 01-05-2011, 08:58 AM
How would you write given query using active record - by El Forum - 01-05-2011, 09:01 AM
How would you write given query using active record - by El Forum - 01-05-2011, 09:24 AM
How would you write given query using active record - by El Forum - 01-05-2011, 10:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB