The SQL query counts the sum of the fields for a specific user ..
In phpMyAdmin, the result is:
SUM(square) 512
Script
$s = "SELECT SUM(square) FROM reports WHERE username = '$str';"; $r = mysql_query($s); if ($r) { echo 'Запрос выполнен' ."<br />" ; $Result = mysql_fetch_array($r); $user = $Result[SUM(square)]; echo $user; }
How to display the result of this query?