jb22b4 Posted July 14, 2009 Share Posted July 14, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/165869-newbie-question-how-to-account-for-an-undetermined-number-of-data-sets/ Share on other sites More sharing options...
rhodesa Posted July 14, 2009 Share Posted July 14, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/165869-newbie-question-how-to-account-for-an-undetermined-number-of-data-sets/#findComment-874920 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.