Good day! I'm a newbie to PHP and would like to ask some help.
I have a code for auto generating a question from database together with 5 checkbox. My problem is that, how can I save different value from the checkbox?
Any idea would be greatly appreciated!
<?php
$sql = "SELECT * FROM question_pool_registrar WHERE criteria_id = 1";
$result = $connect->query($sql);
if($result->num_rows > 0){
while($row = $result->fetch_assoc()){
$question = $row['question'];
echo "<tr>
<td>$question</td>
<td><input type='checkbox' value='1C-Q1-5' name='answer1' class='radio'></td>
<td><input type='checkbox' value='1C-Q1-4' name='answer1' class='radio'></td>
<td><input type='checkbox' value='1C-Q1-3' name='answer1' class='radio'></td>
<td><input type='checkbox' value='1C-Q1-2' name='answer1' class='radio'></td>
<td><input type='checkbox' value='1C-Q1-1' name='answer1' class='radio'></td>
</tr>";
}
}
?>