Jump to content

php sum


DrTrans

Recommended Posts


$query = "SELECT SUM(Amount) FROM `gldetail` WHERE Property_ID = '$propertyid'"; 
		$result = mysql_query($query);
        $sum = mysql_result($result,0);
echo"$sum";

 

Basically in my gldetail table there are 5 fields " Amount, Property_ID, Lease_ID, " I want to take all the amounts and get them into a whole figure by the "Property"

 

 

Link to comment
https://forums.phpfreaks.com/topic/198510-php-sum/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.