It looks as though you are not updating the recordsets to go to the next record within your looping. I did not see any MySQL fetch assoc function calls within the looping around the checkboxes so it seems that this is the problem.
Do you have a live page that you can link to? This would help us to see the source and determine what values the checkboxes are getting and the best way to update it. Please post back with this and if you can a copy of your db so that we can do some testing with this.