Looks to me that you're over complicating things.
Whty not have:
Table country
- primary key: (country_id)
Table state
- primary key: (state_id)
- foreign key: (country_id)
Table city
- primary key: (city_id)
- foreign key: (state_id)
Tom
CaioHC wrote:
Doubt:
I have a schema in
Then you can do:
echo $city;
echo $city-getState();
echo $city-getState()-getCountry();
Tom Haskins-Vaughan wrote:
Looks to me that you're over complicating things.
Whty not have:
Table country
- primary key: (country_id)
Table state
- primary key: (state_id)
- foreign key: