Tengo dos PHPs: uno para mostrar una tabla entera con información y campos y otro para guardar los cambios mediante un for php y demás. El caso, que me gustaría hacer que se guardara en el mismo PHP, es decir, que no se cambie la página. He estado leyendo que se podría hacer con JavaScript o con AJAX, pero no domino ninguno de esos temas. ¿Me podríais dar el código o pistas para poder hacerlo? Dejo el PHP de guardar los cambios y el array que me devuelve PHP que meto en la DB.
Código del array:
Ver original
Array ( [Items] => Array ( [0] => NC1 [1] => NC2 [2] => NC3 ) [1] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [2] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [3] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [4] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [5] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [6] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [7] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [8] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [9] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [10] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [11] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [12] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [13] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [14] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [15] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [16] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [17] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [18] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [19] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [20] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [21] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [22] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [23] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [24] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [25] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [26] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [27] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [28] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [29] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [30] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [31] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [32] => Array ( [0] => 4 [1] => 5 [2] => 6 ) [33] => Array ( [0] => 7 [1] => 8 [2] => 9 ) [Tabla] => PROF2-ASIG1-EV2 [Curso] => 1 [Ev] => 2 )
Código PHP:
Ver original
<?php require ("../../../SiempreAdjunto.php"); $Query = "UPDATE `".$_GET['Tabla']."-Cuaderno` SET `".$_GET['Items'][$i]."` = '".$_GET[$a][$i]."' WHERE `NumeroLista` = '".$a."'"; $MyQuery = $MyConnect->query($Query); } } ?>