I\'ve made a form that allows users to submit their name, a comment and a score from 1-6, which then is saved in a table in their respective fields; name, comment and score. I
Give your result an alias, It makes accessing it easier.
Use mysql_fetch_assoc() to get your results
$result = mysql_query("SELECT AVG(fieldName) AS avg FROM tableName"); $row = mysql_fetch_assoc($result); echo $row['avg'];
FYI, mysql_* is obsolete. Try PDO or mysqli instead.
mysql_*