Best way to create a "spreadsheet" using two tables.
Posted: Sun Jul 05, 2009 10:24 am
Hello everyone,
I have one sql table called users. This stores the username, and a user id(random 6 digit number). . One more table is called events storing the event name and an event id. I have another table called attendence which stores the attendance of members. It stores the event id, and user id.
Now, my goal is to create a table. I want to put the users listed vertically, the events listed horizontally, and a check mark if the user as attended an event, and no check mark if the user has not attended the event.
I was thinking the best way to do this would be to "Generate" the table line by line. First i would generate the event headings, then start generating the members. For each member,id start a loop which would walk the whole events table, and make a query where the user id and event id match. If such an entry is found,that means the user has attended an event, and i should put a check mark. If i do not find an entry, then no check mark. This would however require me to put a event id which is not random.
Any other suggestions on how to go about? Recap:Make a table showing the attendence of members with members going vertically,and events going horizontally.
I have one sql table called users. This stores the username, and a user id(random 6 digit number). . One more table is called events storing the event name and an event id. I have another table called attendence which stores the attendance of members. It stores the event id, and user id.
Now, my goal is to create a table. I want to put the users listed vertically, the events listed horizontally, and a check mark if the user as attended an event, and no check mark if the user has not attended the event.
I was thinking the best way to do this would be to "Generate" the table line by line. First i would generate the event headings, then start generating the members. For each member,id start a loop which would walk the whole events table, and make a query where the user id and event id match. If such an entry is found,that means the user has attended an event, and i should put a check mark. If i do not find an entry, then no check mark. This would however require me to put a event id which is not random.
Any other suggestions on how to go about? Recap:Make a table showing the attendence of members with members going vertically,and events going horizontally.