How can I relate a table with multiple records from another table?
Basically, I have a table for an ‘event’, how do I keep track of which ‘users’ (in their own seperate table) are in a particular event? Right now I just have a column in the ‘event’ table with a comma separated list of the users IDs who have joined that ‘event’.
There must be a better way to do this…right?
Typically you have a table called
users_in_eventwhich holds one row for each user in a many-to-many relationship with theeventstable. So for each event, you will have a number of table rows mapped individually to users.To find out which users are in an event, do: