Multiple dates on one id?

Who can help me, I'm really stuck! I'll start at the beginning. I am making a platform for the cycling club. This contains all members. The intention is to keep track of all attendance and which group they drove. Now I already have a whole system, but to be able to fill in the attendances does not work. You should select the date. Then there are input fields for each member. Such as km, rode along yes or no and which group. So now I would like to save everything to yet another document. But this doesn't work. question 1 you can put different dates with the entered data under the same id. So that under a person you have, for example, 5 dates with the entered values? I can't get this 😦 who can help me, even enabled chatGTP but this simply does not work..
11 Replies
Jochem
Jochem2y ago
it would help if you shared what database system you're using, and what your schema looks like
Rianẍa
RianẍaOP2y ago
would this help? I use the SQL
No description
Jochem
Jochem2y ago
I think you may need an extra layer of abstraction. I'm assuming the attendance is to an event that's run multiple times? so you have an event or route table somewhere, and then every time a group rides that route, you can add attendance for that instance of the route/event?
Rianẍa
RianẍaOP2y ago
we are a cycling club, but to see who has ridden the most rides at the end of the season, we want to build this up. I already made a reset button. So that at the end of the season all members start back at 0. Only I still have to find how it will be stored in a file so that you can see other years. (but that's for later) ----------- as the picture is now. Of course more members need to be added, but due to an error I have to add them again
No description
Jochem
Jochem2y ago
yeah, you need a layer of abstraction here. You probably need a members table, an events table, and an attendance table. The attendance table references members and events, and has values for kilometers, groep, meegereden, en datum you're looking for a many-to-many relationship, with additional fields on the reference / relation table
Rianẍa
RianẍaOP2y ago
how can i fix this then? I'm a beginner sorry. I already have the membership list
Jochem
Jochem2y ago
is there a ride abstraction here? Or is this just a list of all the rides anyone went on without specifying groups or rides or anything else?
Rianẍa
RianẍaOP2y ago
This must be the list of all riders. The most ride everytime on the same groep. But there are some people that switches of groep So without specific groep it can switch
Jochem
Jochem2y ago
hm, then I think you can get away with just adding an entry to the attendance table for every ride you'd have one date per ID, but multiple IDs per user
Rianẍa
RianẍaOP2y ago
How can I do that? Have you a example?
Jochem
Jochem2y ago
You'd just add more rows for each time a person attends a ride not really sure how to give an example of that beyond that
Want results from more Discord servers?
Add your server