<?php
if (isset($_POST['buscar'])) {
$grado=$_POST['grado'];
$sec=$_POST['seccion'];
$query="SELECT * FROM estudiante WHERE Grado='$grado' AND Seccion='$sec'";
$resultado=$conexion->query($query);
while ($row=$resultado-> fetch_assoc()) {
$targeta=$row['CodigTarge']; ?>
<tr>
<td class="center" ><input type ="text" readonly="readonly" name="targeta" value="<?php echo $targeta; ?>"/></td>
<td class="despla" ><?php echo $row['nombre']?><?php echo $row['apellido']?></td>
<td class="mod" >"><input type ="text" required name="nota" placeholder="salario" value=""/>
</td>
</tr>
<?php
}
} else {
?>
<tr> <td class="center">ingrese grado y seccion</td></tr>
<?php
}
?>
</tbody>
</table>
<input type = "submit" value="Guardar" name="Guardar"/>
<?php
if (isset($_POST['Guardar'])) {
$resultado=[];
$captura=array($_POST['targeta']=>$_POST["nota"]);
foreach ($captura as $targeta=>$nota) {
echo "su numero de targeta es $targeta tine nota $nota.<br/>";
}
}
?>
** this is my code I have the problem that I can not save all the rows of the table I only add the last one **