I'm trying to run a query through the ORM like this:
SELECT * from table where (fname like 'string%' or lname like 'string%')
AND (fname like 'string2%' or lname like 'string2%');
Here's what i have so far:
$results = ORM::factory('profiles');
foreach ($strings as $string) {
$result->where('fname', 'like', "$string%");
$result->or_where('lname', 'like', "$string%");
}
But this doesn't account for the parentheses. Any ideas?