Jump to content

Newbie Question: How to account for an undetermined number of data sets.


jb22b4

Recommended Posts

I'm new to php/mysql and just need to be pointed in the right direction.

 

I am making a website to display my family history.  I have an html form that I input each person's data and save it to the database.  How can I make the form and database account for multiple marriages?  Right now I just have seperate columns "Marriage 1", "Marriage 2", "Marriage 3" etc...  But I know there is probably a better way.

 

Any suggestions would be very helpful.

 

Justin

You need a relational database. So, table 1 would be people. Each row is a different person and will need a unique id. Then, table 2 is marriages. Each row in that will be a different marriage and will have the unique id of one person in the first column and the other person in the second column. You can also add additional columns for marriage date, divorce date, etc

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.