Answers for "calculate sum (total) of column in php"

PHP
0

How to calculate the sum of values in a list PHP

$array = explode( ' ', $variable);
echo array_sum( $array);
Posted by: Guest on February-06-2021
0

calculate sum (total) of column in php

mysql_connect($hostname, $username, $password);
mysql_select_db($db);

$sql = "select sum(column) from table";
$q = mysql_query($sql);
$row = mysql_fetch_array($q);

echo 'Sum: ' . $row[0];
Posted by: Guest on October-11-2021

Code answers related to "calculate sum (total) of column in php"

Browse Popular Code Answers by Language