I have a small script, I have it adding up all of the number in a MYSQL column and echoing the result. I am trying to take the sum or echoed number and multiply it by 100. I can’t seem to get it to echo the multiplication.
Here is the code i am using. Any help would be great, Thanks in advance.
//connect to db
$q = mysql_query("SELECT SUM(oil_production) as sum FROM wp_wct3 WHERE oil_production > 0") or die(mysql_error());
$row = mysql_fetch_assoc($q);
echo $row['sum']; echo " BOM"
echo $total = ($result['sum'] * 100);
?>
UPDATED ANSWER
EDIT –
ONCE You’re referring the array of results as
rows[]and once asresults[]… this it the error…