RE: [PHP-DB] Question about database design
| From: | Bastien Koert | Date: | Wed, 24 Oct 2007 13:30:06 +0000 |
| Subject: | RE: [PHP-DB] Question about database design | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44263@lists.php.net to get a copy of this message | ||
I would approach this by having a main people table (with a unique id of course) and then create a
second addresses table which uses the people Id key as the foreign key to this table...then you can
have multiple (more than two) addresses for those users, you could add a season in the addresses to
be able to pull the correct one based on date
bastien> To: php-db@lists.php.net> From: japruim@raoset.com> Date: Wed, 24 Oct 2007
bastien> 09:06:29 -0400> Subject: [PHP-DB] Question about database design> > ********I sent this to
bastien> the MySQL list but didn't receive any > response, My apologies if you have already received
bastien> this.> > > Hi Everyone,> > So having learned my lesson with the last application, I
bastien> am trying to> plan out the addition of a feature to my database application.> Basically, some
bastien> of my customers go south for the winter ("Snow> Birds") what I would like to do is have
bastien> away of storing both their> addresses in the database, and have it so that the people>
bastien> administering the list can choose between wether they are up north or> down south without having
bastien> to erase the old address.> > For that I was thinking creating a second table
bastien> "SnowBirds" and list> their southern addresses in there and then when the list admin
bastien> clicks> on the edit button for their name, it would also be able to pull up a> list of the the
bastien> addresses stored and associated with that person.> > I'm also considering adding a date
bastien> range for the addresses so that if> they know they'll be south from November to March it
bastien> will check the> date and switch between the record accordingly BEFORE exporting to> excel.>
bastien> > Now... I haven't really asked a question yet but gave some background> into what I want
bastien> to do. Sooooo... Here's the question, does anyone> have any advice on the best way to do it?
bastien> Am I right in thinking that> a second table is required? Would it be called a Relational
bastien> database?> Or have I missed the terminology?> > Any help would be greatly appreciated!>
bastien> > Thanks for looking!> > ohhh... and in case it makes a difference it's MySQL 5.* and
bastien> I'll be> writing the stuff to access that database with php 5.> > --> > Jason
bastien> Pruim> Raoset Inc.> Technology Manager> MQC Specialist> 3251 132nd ave> Holland, MI,
bastien> 49424> www.raoset.com> japruim@raoset.com> >
_________________________________________________________________
Express yourself with free Messenger emoticons. Get them today!
http://www.freemessengeremoticons.ca/?icid=EMENCA122