while ($values = mysql_fetch_array($resultnome)){
//build an array here of all the names that were pulled
$quizarray = $values[nomequiz];
}
//join the array into a string separated by commas
$list = join(",", $quizarray);