Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to fetch the sum of column in php mysql

$result = mysqli_query($conn, 'SELECT SUM(value) AS value_sum FROM codes'); 
$row = mysqli_fetch_assoc($result); 
$sum = $row['value_sum'];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fetch #sum #column #php #mysql
ADD COMMENT
Topic
Name
9+5 =