SELECT 
        SUM(quantity)*SUM(total) As mySUM
FROM
        table
WHERE
        ...


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 4:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] math calculations query


hi all,

i have a script which selects description, price and quantity from a mysql
table.

i have displayed the results on a page in the form of description, price,
quantity but I was wondering how best to go about calculating a total total,
ie. sum of quantitys multiplied by sum of prices.

Any ideas?

Many thanks,

Sean.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to