I have a table for users, a table for cities and a table for states. Each user
has a city
, identified by city_id
in its columns, and each city
is related to a state
by state_id
key.
I want to get a list of users in each state, but I don't know how to access the user
list using the city
and the state
.
All of them have, of course, their models, views and controllers (generated by bake). I didn't make any changes after bake generated them, except for users, whose password is salted and hashed before inclusion.
CakePHP is the latest (2.2.4), I'm using an AMP stack installed by myself and correctly configured.