Weclome aboard bzenker, checkboxes will only be set in get/post if they are checked which makes parsing them out much easier.
can I extract the unique id value from the database which gets generated automatically and use it as a value for my checkbox?
Yes.
To parse the values, you can use an array,
<input type="checkbox" name="timeslot[]" value="some value">
in which case you'd step through the array,
if (isset($_POST['timeslot'])) {
foreach ($_POST['timeslot'] as $value) {
echo "$value found <br>";
}
}
... or a named field. The named field shouldn't begin with a number (but I guess, will work, it's just a bad idea for various reasons.)
$name = 'timeslot_' . $id;
<input type="checkbox" name="$name" value="some value">
The only difference is you'd have to step through all of $_POST looking for them.
foreach ($_POST as $key=>$value) {
if (preg_match('/timesheet\_\d+/',$key)) {
echo "$key and $value found <br>";
}
}