Jump to content

How should I design this?


chantown

Recommended Posts

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!

Link to comment
Share on other sites

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.