Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.