Jump to content

calculate sum from mysql column


funbinod

Recommended Posts

i tried this
$TotalSales = mysql_fetch_array($sales);$TotalReceipts = mysql_fetch_array($receipt);$TotalBalance = $TotalSales - $TotalReceipts;echo $TotalBalance;

what is the problem????

Edited by funbinod
Link to comment
Share on other sites

 

Did you test this?

echo "SELECT SUM(amt) AS TotalSales FROM sales where cid = '$cid'";

 

yes i tried that. both '$TotalSales' & '$TotalReceipt' give the perfect value. but while using math between them is not working..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...