jcstanley Posted August 21, 2007 Share Posted August 21, 2007 Hi I have a mysql database which is used to run a club website, but I am not quite sure how to set up some relationships. I have a table called ' Members' containing all the members names etc. The club has a number of committees and each member can belong to more than one committee. Therefore I have created another table called 'Committees' listing all the different committee names. Thats where I get stuck. How do I associate the members with the committees. What I intend to do is have a webpage for each commitee displaying all of the members whithin that committee. Hope this is making sense. If you need more info please just ask. Many thanks Link to comment https://forums.phpfreaks.com/topic/65951-advice-needed-on-mysql-relationships-design/ Share on other sites More sharing options...
vijayfreaks Posted August 21, 2007 Share Posted August 21, 2007 Hi.. For that create one more table that will contain member_id and committees_id as foreign key from relative table. Regards, Vijay Link to comment https://forums.phpfreaks.com/topic/65951-advice-needed-on-mysql-relationships-design/#findComment-329729 Share on other sites More sharing options...
pranav_kavi Posted August 21, 2007 Share Posted August 21, 2007 i suppose u wud b ving a memberID in ur 'Members' table and committeeID in ur 'Committee' table. Have a join table like 'committee_members' that has 2 columns-memberID & committeeID .so this table wud store the mapping information. hope tis helps.. Link to comment https://forums.phpfreaks.com/topic/65951-advice-needed-on-mysql-relationships-design/#findComment-329730 Share on other sites More sharing options...
jcstanley Posted August 21, 2007 Author Share Posted August 21, 2007 thanks for that. just one more question - I am using phpmyadmin, how do you create foreign keys to link the tables? Link to comment https://forums.phpfreaks.com/topic/65951-advice-needed-on-mysql-relationships-design/#findComment-329735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.