01-10-2019, 11:05 AM
That's where the user_id comes from. When a user signs up, their id gets inserted into the signups table, so if
yoga is event 1
dodgeball is event 2
my signup would look like
id = whatever(doesn't matter)
event_id=2(dodgeball)
user_id=17(my id in the users table)
day = wednesday
Basically that signup table ties the users table (user_id) together with the events table (event_id) and adds the day that I want to sign up for. All of a sudden we have these 3 tables that work together without caring how many rows the other has. You can have unlimited users, unlimited events and unlimited signups and because the ids "relate" the info from one table to another, it's infinately dynamic.
My adding to the users table you have to keep creating my more events and more times and more everything until it gets out of control.
There are ways to make it more dynamic (more than one yoga per day etc), but like I said, this is how that works at its core.
You'll notice we do the same thing in userspice.
The pages table is an id for each page.
The permissions table is an id for each permission level
page_permission_matches determines which permission level can visit which page.
yoga is event 1
dodgeball is event 2
my signup would look like
id = whatever(doesn't matter)
event_id=2(dodgeball)
user_id=17(my id in the users table)
day = wednesday
Basically that signup table ties the users table (user_id) together with the events table (event_id) and adds the day that I want to sign up for. All of a sudden we have these 3 tables that work together without caring how many rows the other has. You can have unlimited users, unlimited events and unlimited signups and because the ids "relate" the info from one table to another, it's infinately dynamic.
My adding to the users table you have to keep creating my more events and more times and more everything until it gets out of control.
There are ways to make it more dynamic (more than one yoga per day etc), but like I said, this is how that works at its core.
You'll notice we do the same thing in userspice.
The pages table is an id for each page.
The permissions table is an id for each permission level
page_permission_matches determines which permission level can visit which page.