this is my page
notes.php
And this is the code I have, what it does is select the students and print their notes.
Select notes to add
<select id="combito">
<option>Notas</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
Select the module:
<select id="combito2">
<option>Materia</option>
<option value="lenguaje">History</option>
<option value="matematicas">Math</option>
</select>
<div id="div_1" class="contenido">
<table>
<thead>
<tr>
<td>RUT</td>
<td>Nombre</td>
<td>Apellido</td>
<td>Notas</td>
</tr>
</thead>
<tbody>
<?php
$connect = mysqli_connect("localhost","root", "","liceo");
if (!$connect) {
die(mysqli_error());
}
$results = mysqli_query($connect,"SELECT rut, nombre, apellido FROM alumnos");
while($row = mysqli_fetch_object($results)) {
$rut = $row->rut;
$boo = 0; /* Iniciamos la Variable Auxiliar
que indicará cuantas notas se imprimió por cada Alumno */
$results2 = mysqli_query($connect,"SELECT nota FROM notas WHERE rut_alumno = '$rut' AND id_materia=1 LIMIT 1");
?>
<tr>
<td><?=$row->rut?></td>
<td><?=$row->nombre?></td>
<td><?=$row->apellido?></td>
<td>
<?php
while($nota = mysqli_fetch_object($results2)):
?>
<input type="text" name="pin" maxlength="2" size="2" value="<?=$nota->nota?>">
<?php
$boo +=1;/* Incrementamos después de Imprimir la nota del Alumno*/
endwhile;
/* Si la variable es menor a 2 , es decir no se imprimieron las 2 notas respectivas*/
if($boo<1){
/* Imprimimos inputs de value 0 hasta que sea < 2 , dado que si el
el valor de $boo es 1 o 0 , primero se realizará el echo y luego el incremento
Sí $boo es 0 -> Iteración 0 - Imprime el input - Incrementa $boo -> $boo = 1
Iteración 1 - Imprime el input - Incrementa $boo -> $boo = 2
Termina el for dado que 2 no es menor que 2
Sí $boo es 1 -> Iteración 0 - Imprime el input - Incrementa $boo -> $boo = 2
Termina el For dado que 2 no es menor que 2
*/
for (; $boo < 1; $boo++) {
echo '<input type="text" name="pin" maxlength="2" size="2" value="10">';
}
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="button" value="Save notes">
</div>
The problem is that I do not know how to save all the "inputs" that are generated. For example if I have 11 names there will be 11 inputs generated, and if there are 12 students there will be 12 inputs that will be generated as well. Then I would like to know how to save the value of those notes, in my table.
This is my table
notas
I appreciate if can guide me


Notascolumn? Your code has awhileloop that should put an input for every row returned by the query. If the query only returns one row, why are you using a loop?LIMIT 1in the second query. Why do you need awhileloop to fetch just one row of results?