PHP capture bidimensional arrangement

0

I have been trying to solve a topic, but I have not found the answer ...

This piece of code finishes generating an AxB matrix from data retrieved from a database.

<?php for ($i=1;$i<=$cantidad_notas;$i++){                      
          $na = mysqli_fetch_row($notas3);?>
          <td>
              <input type="hidden" name="id_alumno[][]" value="<?php echo $ver[0] ?>"/>
              <input type="hidden" name="id_nota[][]" size="1" value="<?php if($na[0]!=0){echo $na[0];}else{echo '""';} ?>"/>
              <input type="number" class="form-control-sm" name="nota[][]" size="1" value="<?php echo $na[4]; ?>" min="10" max="70"/>
          </td>
<?php } ?>

The issue is that I do not know how to go through it when I receive it to make the changes, since I only manage to go through the first row of the matrix with this code:

$nota = $_POST['nota'];
for($j=0;$j<$cantidadAlumnos;$j++){
    for($i=0;$i<$cantidadNotas;$i++){
        echo $nota[$i][$j];
    }
}

and obviously so with the other variables ...

    
asked by Chumy Blanco 15.05.2018 в 06:25
source

1 answer

0

$ query="SELECT name, last name FROM Person";

if ($ result = $ mysqli-> query ($ query)) {

/* obtener el array de objetos */
while ($fila = $resultado->fetch_row()) {?>
    <td>Agregas lo que necesitas de tu resultado....</td>
<?}

/* liberar el conjunto de resultados */
$resultado->close();

} This will return the values that are in each field.

    
answered by 16.05.2018 в 23:36