Quando esegui il cilco metti 2 array con tutti gli id e punteggi della tabella.
In $array_id hai tutti i tuoi id dei record.Codice PHP:$arrai_id = array();
$arrai_punteggi = array();
while ($row = mysql_fetch_array($result))
{
$i++;
$arrai_id[] = $row['id'];
$arrai_punteggi[] = $row['punteggio'];
echo"<tr>
<td align=\"right\">$row[squadra]</td>
<td><input type=text size=2 name=punteggio$i value=\"$row[punteggio]\">
</td>
</tr> ";
}
In $array_punteggi hai tutti i tuoi punteggi con lo stesso ordine di array_id.
Nella pagina di update potresti fare una cosa tipo:
[php]
$i=0;
foreach ($array_id as $id)
{
$i++;
//inserimento nel DB
$query = "UPDATE stagione SET punteggio=$array_punteggio[$i] WHERE id='$id'";
}
[php]
Per passare i 2 array alla pagina di update vedi tu. Potresti metterli in sessione per comodita'. session_start() in testa a entrambe le pagine e in quella di estrazione:
Nella pagina di update ti ritroverai i due dati $_SESSION.Codice PHP:$_SESSION['id'] = $array_id;
$_SESSION['punteggi'] = $array_punteggi;

Rispondi quotando