Jump to content

echo sum() problem


dannybrazil

Recommended Posts

To get your results from your query you need to use ond of the mysql_fetch_* functions, such as mysql_fetch_assoc. This function will return each row as an associative array

 

$query = "SELECT SUM(total)  FROM account";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
    echo $row['SUM(total)'];
}

Link to comment
https://forums.phpfreaks.com/topic/189549-echo-sum-problem/#findComment-1000504
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.