I am trying to echo the sum of the records in a table and it returns empty.
$query = "SELECT SUM(number) AS total FROM records"; $result = mysql_query($query); echo 'the total is:'; echo $total;
When I echo the query it appears as above, when I echo the $result it says Resource ID#5. When I echo $total is is empty. What am I doing wrong?