For those requiring the same solution, I solved this by setting all fields to 0 and switching logic around somewhat (0 = off, 1 = on).
It's WAY easier to check for checked boxes than the empty ones.
if ($HTTP_POST_VARS[Submit]) { // Update the product
$sql = "UPDATE categories SET active='0'";
mysql_query($sql);
for ($i=0; $i<count($categories); $i++) {
$key = $categories[$i];
echo "Record $key is checked!<BR />";
mysql_query ("UPDATE categories SET active='1' WHERE product_name_id='$key'");
}
}