coolbeansdude51 Posted May 18, 2009 Share Posted May 18, 2009 Hello all. Here is the problem. I have an application with users. I need to put those people into groups. Right now I have a separate table full of the groups. I query the groups table to place all the data in the form. Then I need to place data in table called members which has all the members data in it. Right now I have 1 field holding all the group data. I serialize the group array and then unserialize it when I need to pull it out. It works but I there has to be an easier way or a more correct way. I am running into problems when I need to build an msyql query to find members based on which groups they are in and then execute a script based on the members group association. Here are some thoughts: Would it just make more sense to create a field in the members table for each group? That would be a pain because the number of groups is constantly changing ... Pull in all the members into an array ... and the members groups then search through it building another array full of the members that meet the criteria ... Hopefully that makes sense. Let me know! Any idea's? Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/ Share on other sites More sharing options...
coolbeansdude51 Posted May 18, 2009 Author Share Posted May 18, 2009 Anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/#findComment-836738 Share on other sites More sharing options...
luca200 Posted May 19, 2009 Share Posted May 19, 2009 It seems like you don't know too much about normalization. If I understand your matter, you'd better create a "users-groups" table in which you'll store a record for each user of each group Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/#findComment-837026 Share on other sites More sharing options...
coolbeansdude51 Posted May 19, 2009 Author Share Posted May 19, 2009 It seems like you don't know too much about normalization. If I understand your matter, you'd better create a "users-groups" table in which you'll store a record for each user of each group You are right ... I don't know much about normalization at all. Thanks for the idea! To make sure I understand you correctly. It would look something like this: record1 = member1 group1 record2 = member1 group2 record3 = member2 group1 Something to that effect ... Correct? Thanks for your reply and time. I really appreciate it. Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/#findComment-837028 Share on other sites More sharing options...
luca200 Posted May 19, 2009 Share Posted May 19, 2009 Yes, that's correct. That way it makes much simpler to write a query, you see? You're welcome Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/#findComment-837030 Share on other sites More sharing options...
coolbeansdude51 Posted May 19, 2009 Author Share Posted May 19, 2009 Yes, that's correct. That way it makes much simpler to write a query, you see? You're welcome I do see thanks! Quote Link to comment https://forums.phpfreaks.com/topic/158544-solved-storing-mult-select-form-data-in-mysql/#findComment-837031 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.