First off, checkboxes must have unique names.
Only radiobuttons share a common name.
I'm not sure if daarius' solution works for checkboxes too, but it should work for
selectboxes.
In HTML you can make a checkbox or radiobutton appear "selected" by adding "checked" in the tag, like this:
<input type="checkbox" name="my_checkbox" value="the_value" checked>
(some other form elements use "selected", you may have to look them up)
So when you diplay the form after the database update, use an IF statement
to check and uncheck the boxes using the data from the database.