> I've been looking for a while but I can't seem to find the solution.
>
> Basically, I have Countries, which has many States, every State has
> many Cities, and every City has many Users.
> I'm trying to get all the Users in a specified State, and I don't want
> to put a state_id in the user table, because it's relative to the city
> hes.

I would do this with 2 queries. First, get the IDs of all the cities
in the state, then get all the users that belong to those Cities, eg:

$cities = $this->User->City->generateList(array('City.state_id'=>$state_id));

$users = $this->User->findAll(array('User.city_id'=>$cities));

hth

jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to