Troppo difficile spiegare con delle parole. Studia questo.
Codice PHP:
<?php
foreach($id as $key => $value){
$old_points = $punteggio[$key];
$new = $agg_punti[$key];
$new_point = $new + $old_points;
if($update = $mysqli->query("UPDATE ragazzi SET punteggio = '$new_point', aggiornato = NOW() WHERE id = '$value' ")){
echo "<p></p><div class=\"tabella\">Dati aggiornati ed ordinati!</div>";
echo "<meta http-equiv='Refresh' content='500; URL=".htmlspecialchars($_SERVER['PHP_SELF'])."'>";
echo "OOOOOOOOKKKKKKKKKKKKKKKK!!!! <br>";
} else {
echo "Aggiornamento non riuscito!\"<br>";
echo "Errore:" . $mysqli->error .".";
}
}