$result is not a valid result resource so your query is not returning any records. Looking at your code it is possibily that you have not given the database name a string with quotes in
mysql_select_db(classeval);
try
mysql_select_db('classeval');
I always test $result and echo out an error if there are no records and there should be:
if (!$result = mysql_query($query)) echo "no records found. Query was: $query";
Hope this helps,
Cris