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
https://forums.phpfreaks.com/topic/68940-how-should-i-design-this/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.