Displaying the sum of an entire column
Posted: Wed Mar 08, 2006 3:02 pm
My code looks like this:
The echo'd result is this:
Resource id #4
What am I doing wrong?
Code: Select all
$sql = "SELECT SUM(`totalgiven`) FROM `accounts`";
$result=mysql_query($sql);
$allgiven = $result;
echo $allgiven;Resource id #4
What am I doing wrong?