Welcome Guest, Not a member yet? Register   Sign In
Multiple Tables in FROM Statement in DB Active Record
#1

[eluser]lay-z-cow[/eluser]
Hi,

maybe this question is stupid, but I couldn't find anything about this in the User Guide:

I want to start a mySQL query like this:
Code:
SELECT
person.person_id,
person.name,
bew2proj.status_id,
bew2proj.b2w_id,
company.company_id,
company.name
FROM
bew2proj,
person,
company
WHERE
bew2proj.person_id = person.person_id
AND person.company_id = company_id.company_id_id
AND person.company_id = ' . $company_id . '
AND bew2proj.projekt_id = ' . $_POST['ID'];

How do I rewrite this query for the Active Record? Do I have to use JOIN?


greetings

Chris


Messages In This Thread
Multiple Tables in FROM Statement in DB Active Record - by El Forum - 04-13-2008, 10:46 AM
Multiple Tables in FROM Statement in DB Active Record - by El Forum - 04-13-2008, 10:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB