Wednesday, July 6, 2011

relationship between Sate and City

Hi,

I am trying to define relationship between state and city.

State hasMany City -- foreign key state_id in City
City belongsTo State

State fields: id, state_name
City fields: id, city_name, state_id

but for City belongsTo State, it seems illogically to set a foreign
key in State coz' then State records will be repeating.

What is the best way to go about this?

thank you.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate