Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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];
Comment

PREVIOUS NEXT
Code Example
Php :: php imap install 
Php :: php get highest key value 
Php :: laravel blade variable isset, empty or optional 
Php :: php curl example 
Php :: laravel eloquent where id not equal to 
Php :: laravel echo query 
Php :: How do I check if a string contains a specific word? 
Php :: count remaining days php 
Php :: return view controller laravel 
Php :: laravel old value not working in textarea 
Php :: php get url 
Php :: laravel model limit 
Php :: gmdate in php 
Php :: get woocommerce order details 
Php :: php controller 
Php :: lat long in laravel validation 
Php :: install laravel 
Php :: php or 
Php :: carbon laravel d m y to y-m-d 
Php :: random digit with seed php 
Php :: php remove anchor tag from string 
Php :: php eliminar elementos vacios array 
Php :: lcomposer symfony/filesystem 
Php :: how to get current location in laravel 
Php :: laravel check empty string 
Php :: cloudflare ip country 
Php :: execute specific migration laravel 
Php :: how to define function in php 
Php :: dompdf with qr code 
Php :: laravel validation mimes always fails 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =