I have a MySQL database of my movie collection and I'm working on a little website for searching and editing the database. The whole project is more of learning thing then just trying to get it done the easiest way. So I am writing it all from scratch, just plain text files, and I am using mostly PHP.
So I want a page where I can edit the information about a movie. Adding new information is fairly straightfoward, but what about removing information. I have several checkboxes for genres. When the form comes up, any genre currently related to the movie is checked. I want to be able to uncheck a box and then that genre will be dropped from that movie. The only way I can think to do this is create an initial array of values when the form opens, and get the POST array when the form is submitted. Then delete any genres in the first but not the second array. This seems kind of messy, and I feel like there should be a more elegant way to do this. This seems like a pretty standard thing to so maybe people have a nice way to do this?