I have a test in my database, and every question has its answers (Right, Wrong1, Wrong2, Wrong3). I can list the questions in different forms, but my problem is to list responses in radiobuttons
with different names. Since everyone has the same name, when selecting one, the others will be disregarded.
<?php
$instS='Select * from perguntas';
$query = mysqli_query($conn,$instS);
while ($row = mysqli_fetch_assoc ($query))
{echo"<br>";
echo"<center><fieldset style='border:solid; width:500px;'>";
echo" <legend style='background: #FF9; width:150px; border: solid 1px black;
-webkit-border-radius: 8px; -moz-border-radius: 8px;
border-radius: 8px; padding: 6px;'> Questão: ".$row['idPergunta']."";echo"</legend>";
echo "<center> <h4><b> Pergunta: </h4></center></b>";
echo"<center>"
.$row['textoPerguntas'].""; //Buscar a pergunta a base de dados
echo"<center>";
echo "<center><h4><b> Resposta: </h4></center></b>";
// queria aqui buscar as respostas, mas de modo a que a cada set de 4 perguntas, os nomes das radiobuttons fossem alterados (RespostaCerta,Errada1,Errada2,Errada3 name=questao1),
(RespostaCerta,Errada1,Errada2,Errada3 name=questao2), etc, consoante ao numero de perguntas que existe
echo "<input type='radio' name='dd' id='resposta'>";
echo "<br>";
echo "<br>";
?>