Codice PHP:
ho realizzato questo:

<?php include("include/connetti.php");?>
  <?php
$query 
'select COUNT(*) as tot from studenti';
$result mysql_query($query); 
$row mysql_fetch_array($result);
if (!
$result) {
   die(
'Errore nella query: ' mysql_error());
}

echo 
"Studenti n. [b]$row[tot][/b]";
function 
createForm($numStudenti) {
    echo 
'<form action="studenti_salva_voti.php" method="post">';
    for (
$i 0$i $numStudenti$i++) {
        echo 
'studente '.($i 1).': <input type="text" name="voto[]" id="voto[]"/>
'
;
    }
    echo 
'<input type="submit" name="submit" value="submit" />';
    echo 
'</form>';
}

if (isset(
$_POST['submit'])) {
    
$voto $_POST['voto'];
    foreach (
$voto as $value) {
        echo 
$value."
"
;
    }
}

createForm($row['tot']);
?> 
la tabella (studenti)e così:

id;
stu (numero progressivo dello studente);
nome

adesso vorrei salvare i dati in questa tabella (voti)
così formata:
id;
studente (numero dello steudente);
Voto