I am creating a dynamic questionnaire with MYSQL and PHP 7. In a page I create my questions and my questionnaire and I keep them in MYSQL and in another page I show them making a call to the database to bring me the questions.
only that I have a problem, when calling the questions I want that each question sends me 2 radiosbutton and 2 textarea.
which I do it in the following way.
<table>
<tr>
<!--Mostramos el titulo de la encuesta-->
<td colspan="2"> <h3><?php echo $titulo; ?></h3></td>
<input type="hidden" name="id" value="<?php echo $id; ?>">
</tr>
<?php
//consulta que captura el texto , id de la tabla respuestas
$sql = "SELECT texto,id FROM respuestas WHERE idenc='$id'";
$sql = mysqli_query($conexion,$sql);
//ahora recorremos los datos texto, id que estan vinculadas a la cuenta seleccionada
while ($row = mysqli_fetch_array($sql)){
$texto = $row["texto"];
$idres = $row["id"];
//añiado los radiobuttons y los textarea
?>
<tr>
<td width="50"><?php echo $idres; ?></td>
<td width="470"><?php echo $texto; ?></td>
<td> SI <input type="radio" name="SI" value="<?php echo $idres; ?>"></td>
<td> NO <input type="radio" name="NO" value="<?php echo $idres; ?>"></td>
<td><textarea name="comentarios" rows="5" cols="20">Escribe aquí tus Hallasgos</textarea></td>
<td><textarea name="comentarios" rows="5" cols="20">Escribe aquí tus Acciones Correctivas</textarea></td>
</tr>
<?php } ?>
<tr>
only that this way only allows me to answer two questions and not all the questions of the survey