Welcome Guest, Not a member yet? Register   Sign In
Active Records and complex queries
#7

[eluser]Aken[/eluser]
If you want to do two where groups, you can do something like this:

Code:
$this->db->where('(column = value AND column = value)');
$this->db->or_where('(column = value AND column = value)');

You might need to specify the third parameter of where() and or_where() as FALSE to prevent backtick escaping, if you run into issues with that.

That's the best you're going to get with the current version. Although there's nothing wrong with writing the query out yourself and using $this->db->query() if you want (so long as you don't need to support multiple DB types).


Messages In This Thread
Active Records and complex queries - by El Forum - 08-22-2012, 09:00 AM
Active Records and complex queries - by El Forum - 08-22-2012, 11:49 AM
Active Records and complex queries - by El Forum - 08-22-2012, 12:33 PM
Active Records and complex queries - by El Forum - 08-22-2012, 12:35 PM
Active Records and complex queries - by El Forum - 08-22-2012, 12:53 PM
Active Records and complex queries - by El Forum - 08-22-2012, 10:05 PM
Active Records and complex queries - by El Forum - 08-23-2012, 12:55 AM
Active Records and complex queries - by El Forum - 08-23-2012, 01:42 AM
Active Records and complex queries - by El Forum - 08-23-2012, 02:23 AM
Active Records and complex queries - by El Forum - 08-23-2012, 01:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB