Hello, I am using the SUM() function to add an entire field together....
For example
$sql = "SELECT SUM(user_count) FROM locations WHERE 1";
I'm a little confused on how to get the result to echo to the HTML.
Any help is much appreciated. Thanks.
Two ways, either use [man]mysql_fetch_row[/man] instead of [man]mysql_fetch_assoc[/man] or change your query slightly to something like, "SELECT SUM(user_count) as user_count_sum FROM locations"
ah yeah, that makes sense, thanks.