Insert data into tables through script and based in checkboxes status. How to fill checkboxes from records.
I'm trying to develop a database on students and classes. I have a situation where I have to give to a class the different subjects. In the database I have three tables: one for classes, another for subjects and a third one to relate them. I'm having some difficulties in introducing the data in the last one, because I have to assure that the two first tables (which are a composed key) don't have duplicates. I would like to do a layout like the one in the image, but I don't know how to insert the data in the table based in the selection of the checkboxes. Thank you for your attention.