As I've mentioned before, I don't really know much about PHP and MySQL (my experience is with ASP.NET and T-SQL, which seems considerably more logical), but I did find the following, which might put you on the right track (if someone more knowledgeable doesn't happen by):
Quote:
The mysql_query function returns a resource. If you print a resource
you get the text "Resource id #n" where n is replaced with its ID. To
make use of this resource you need to use functions like
mysql_fetch_array, mysql_fetch_assoc or one of the many others
detailed in the manual.
|
PHP: MySQL - Manual
Since you are using an aggregate function (SUM), I'm guessing that the result set will consist of one row and one column, so (if I understood the manual correctly) you should be able to use the
mysql_fetch_row function to get the value you require, and then display it as follows:
PHP Code:
$row = mysql_fetch_row($total);
echo $row[0];
Alternatively, this might work:
PHP Code:
echo mysql_result($total, 0);