displaying sum of a database value - PHP
<p>Hi I need to get the sum of the database field sbstart. I changed the code to SUM(sbstart) but doesn't seems to be a valid move. How can I display the sum? Thanks.</p>

<pre><code>        &lt;?php


$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'regional_data';
@ $db = mysqli_connect($host, $user, $pass, $db);

if(mysqli_connect_errno())
{
    die('The connection to the database could not be established.');
}
$query = "SELECT SUM(sbstart) FROM newchk WHERE dist_chk ='$distUsr'";
$result = mysqli_query($db, $query);

while ($recS = mysqli_fetch_array($result)){

echo ($recS['sbstart']);    
}
?&gt;
</code></pre>
