<?php 
$query=mysql_query("SELECT cognome_utente, nome_utente FROM classifica ORDER BY tot"); 
$classifica=mysql_num_rows($query); 
echo "<table>";  
//non devi usare l'array globale $_post 
while($classifica=mysql_fetch_array($query)){  
$id=$classifica[id];  
$cognome_utente=$classifica['cognome_utente'];  
$nome_utente=$classifica['nome_utente'];  
$tot=$classifica['tot'];
$punteggio=$_SESSION['punteggio'];
$tot = ($punteggio == 1) ? "$punteggio punto" : "$punteggio punti";
//query di inserimento
$query="INSERT INTO classifica(id, cognome_utente, nome_utente, tot, punteggio) VALUES ('$idl', '$cognome_utente, nome_utente, $tot, $punteggio')";      
   
    $insert=mysql_query($query) or die(mysql_error()); 
    
echo "<tr> 
     <td>$id</td> 
    <td>$cognome_utente</td> 
    <td>$nome_utente</td> 
     <td>Hai totalizzato $tot</td>
    
    </tr>";  
} //fine del while 
echo "</table><br><br>";   
?>