Hey there!
I am currently developing an educational Flash game website. Teachers can customize games for their classes, allowing students to play games with content they have specified. Pretty cool stuff, really.
So to store all of this information, there is a games table (holding all the information for each of the games), a users table (holding info for all the teachers), a classes table (holding info for all of the classes), and then finally a games_available table which will simple store the primary keys of each of the other three tables to know that teacher X has enabled game Y for class Z.
I'm trying now to write a query that will allow me to display a way for teachers to control which games are enabled for which classes. Ideally, each game that has been added to the teacher's list will appear with a checkbox for each one of the teacher's classes. Classes that have that particular game enabled will have the check box already checked.
I'm stumbling quite a bit here, because once I display a listing of each game, and a set of checkboxes for each one of the teachers classes to associate with each game, I don't know how I should go about setting which ones should be checked already (from a MySQL/PHP standpoint, not how to check the boxes with HTML).
All help will be greatly appreciated.
Thanks!
-Ange52