I have a query. How can I enter the data of a set of select's radio into my database ?, I mean, I have a list of students that I need to take assistance from and the list is automatically generated along with the select's radio.
$template_asistencia = '
<form method="POST">
<div class="item">
<table>
<tr>
<th>Nro.</th>
<th>Apellidos</th>
<th>Nombres</th>
<th>
<form method="POST">
<label>Fecha</label>
<input type="date" name="fecha_asistencia" value="'.date("Y-m-d").'"pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
<label>Curso: '.$grado.'° "'.$paralelo.'"</label>
<input type="hidden" name="grado" value="$grado">
<input type="hidden" name="paralelo" value="$paralelo">
<input type="hidden" name="r" value="asistencia-add">
<input type="hidden" name="crud" value="set">
</form>
</th>
</tr>';
$count = 1;
for ($n=0; $n < count($asistencia); $n++) {
$template_asistencia .= '
<tr>
<td>' . $count . '</td>
<td>' . $asistencia[$n]['apellidos'] . '</td>
<td>' . $asistencia[$n]['nombres'] . '</td>
<td>
<form>
<label><input type="radio" name="tipo_asistencia" value="presente"/>Presente</label>
<label><input type="radio" name="tipo_asistencia" value="falta"/>Falta</label>
<label><input type="radio" name="tipo_asistencia" value="atraso"/>Atraso</label>
<label><input type="radio" name="tipo_asistencia" value="licencia"/>Licencia</label>
</form>
</td>
</tr>
';
$count++;
}
$template_asistencia .= '
</table>
<input class="button add" type="submit" value="Guardar lista">
<input type="hidden" name="r" value="asistencia-add">
<input type="hidden" name="crud" value="set">
</div>
</form>
';
printf($template_asistencia);
And I do not know how to insert the data that I take from the radio to my db. Thank you for your attention and for your help. : D P. D .: work with mysqli.