each row of the database should have a unique id (primary key, auto_increment)
<input type="checkbox" name="checkbox[$row['id']]" value="checkbox" value="<?=$row['id']?>">
then have this for when the form is submit
<?php
if ($_POST) {
foreach ($_POST['checkbox'] as $value) {
$csv = $value.', ';
}
$csv = substr($csv, 0, -2);
}
?>
save $csv into your database field or a session then your SQL on the questionnaire page would be along the lines of:
SELECT * FROM `questions` WHERE `id` IN ($csv)