Welcome Guest, Not a member yet? Register   Sign In
Active Record - removing quotes from where()

Hi all. When I want to do something like this using Active Record:
FROM `users`, `groups`
WHERE `users`.`group_id` = `groups`.`id`

I expect to be able to do this:
$query = $this->db->select('*')
    ->from('users, groups')
    ->where('users.group_id', 'groups.id')

However, this produces the following query:
FROM `users`, `groups`
WHERE `users`.`group_id` = 'groups.id'

I am able to prevent this from happening by setting the third parameter of where() to FALSE (which removes the backticks and quotes), however I would rather keep the backticks there. Is there a way to remove the quotes around the second parameter of where() without removing the backticks?

Use the FALSE as third parameter and add the backticks if you think they are important? Smile

[eluser]Phil Sturgeon[/eluser]
The backticks really aren't important. You don't need ->select('*') either.

Theme © iAndrew 2016 - Forum software by © MyBB