Come non detto... ho risolto da solo... popolavo male l'array, posto cmq il codice che ho usato così se qualcuno vuole mi mette una soluzione migliore:

Codice PHP:
$Voti = array();
$Nomi = array();

for(
$i 0$i 8$i++){
    
$res mysql_query('SELECT voto FROM lezioni WHERE studente = '.$Classe[$i]);
    
$temp mysql_fetch_array($res);
    
$Voti[$i] = $temp[0];
        
    
$res1 mysql_query('SELECT nickname FROM studenti WHERE id = '.$Classe[$i]);
    
$temp mysql_fetch_array($res1);
    
$Nomi[$i] = $temp[0];