chantown Posted September 12, 2007 Share Posted September 12, 2007 Hi, I'm looking to make a way where users can sign up for events. There's 2 tables: Events and a table for Users. How should I make it so that my database remembers WHICH events my USERS signed up for? option 1: Is it better to make another table? columns: USER EVENT So, if User 4 signed up for Event 13, 44, and 55, I would: Insert 4, 13 Insert 4, 44 Insert 4, 55 and then I could query WHERE user = 4. option 2: or is it better to make an array of events within the User table itself? (and then *explode* the array to get all the events that he signed up for) Insert into Users ....signedup = "13|44|55" And explode Array with | Basically, how does Facebook do it? How do they keep track of which "groups" people joined? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/68940-how-should-i-design-this/ Share on other sites More sharing options...
AndyB Posted September 12, 2007 Share Posted September 12, 2007 Option 1 is the winner, hands-down. Quote Link to comment https://forums.phpfreaks.com/topic/68940-how-should-i-design-this/#findComment-346529 Share on other sites More sharing options...
chantown Posted September 12, 2007 Author Share Posted September 12, 2007 faster, right? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/68940-how-should-i-design-this/#findComment-346536 Share on other sites More sharing options...
fenway Posted September 12, 2007 Share Posted September 12, 2007 faster, right? thanks! Normalized, faster, better, logical, etc. Quote Link to comment https://forums.phpfreaks.com/topic/68940-how-should-i-design-this/#findComment-347056 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.