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

[eluser]Shella[/eluser]
[quote author="Aken" date="1345708534"]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).[/quote]

Wow, I did not know that it was possible to use this sintax into the where active record. I mean I was sure that only one kind of var was allowed.

Thanks, this is very usefull tips


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