Welcome Guest, Not a member yet? Register   Sign In
Database Active Record error... I think?
#1

[eluser]gregmax17[/eluser]
Hello, I have been CI for a while and it is a great tool. I have just started to learn how to use the Active Record class (before I did all the query by hand), and I have come to stump using it.

I am trying to do a query like so:

SELECT
`users`.`username`, `users`.`privilege_id`
FROM
`users`, `privileges`
WHERE
`users`.`privilege_id`=`privileges`.`privilege_id`

Using the "query" method this works great, but not with the Active Record. It assumes `privileges`.`privilege_id` is a value. So the query comes back as:

SELECT
`users`.`username`, `users`.`privilege_id`
FROM
`users`, `privileges`
WHERE
`users`.`privilege_id`='privileges.privilege_id'

Of course this doesn't return any results.

Any help would be great, thanks


Messages In This Thread
Database Active Record error... I think? - by El Forum - 09-15-2009, 04:29 PM
Database Active Record error... I think? - by El Forum - 09-15-2009, 04:34 PM
Database Active Record error... I think? - by El Forum - 09-15-2009, 04:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB