I have questions that I can answer and everyting but some of them go up to F and some only to D so my question is how do I disable a button with no question behind it and keep the one that have questions.
I couldn't think of a way to solve this so thats why I am asking here.
$sql = "SELECT * FROM questionlist_choice WHERE Qid='$Qid'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
$i = 0;
$p = 1;
while ($row = mysqli_fetch_assoc($result)) {
$vraag = $row['Vraag'];
$vraagA = $row['Vraag_keuzeA'];
$vraagB = $row['Vraag_keuzeB'];
$vraagC = $row['Vraag_keuzeC'];
$vraagD = $row['Vraag_keuzeD'];
$vraagE = $row['Vraag_keuzeE'];
$vraagF = $row['Vraag_keuzeF'];
$kikio = "<div>
<br><p>$p. $vraag</p>
<input type='radio' name='q[$i]' value='A'required> $vraagA<br>
<input type='radio' name='q[$i]' value='B'required> $vraagB<br>
<input type='radio' name='q[$i]' value='C'required> $vraagC<br>
<input type='radio' name='q[$i]' value='D'required> $vraagD<br>
<input type='radio' name='q[$i]' value='E'required> $vraagE<br>
<input type='radio' name='q[$i]' value='F'required> $vraagF<br>
</div>";
echo $kikio;
$i++;
$p++;
}
}
?>
<input value="submit" name="submit" type="submit">
</form>
I hope it will only show radio-buttons when there is a question with it.