我想计算我选择一个选项的次数。那么我选择了多少次 A,B,C,D,E,F 。
我尝试进行某种形式的计数,但没有奏效。
<form action="Antwoord.php" method="POST">
<input type="text" name="Naam" placeholder="Uw naam:">
<?php
$sql = "SELECT * FROM questionlist_choice WHERE Qid='1'";
$result = mysqli_query($conn, $sql);
if ($result->num_rows > 0) {
$i = 0;
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>$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++;
}
}
?>
<input type="submit">
</form>
我期待一个回声或其他东西,显示我选择了多少次 A 被选择了 B 等等。
小唯快跑啊