Re: Getting total quantities
| From: | Karl DeSaulniers | Date: | Mon, 15 Feb 2010 05:36:14 +0000 |
| Subject: | Re: Getting total quantities | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46893@lists.php.net to get a copy of this message | ||
Ok, sweet, then I am on the right track.
Now I did notice that I forgot the SELECT in the first query, does that matter?
Can I just start out with SUM?
Thanks for your response.
Karl
On Feb 14, 2010, at 11:32 PM, Chris wrote:
Karl DeSaulniers wrote:Karl DeSaulniers Design Drumm http://designdrumm.comWould it be? $q = "SUM(ProductStock) FROM products"; or $q = "SELECT SUM(ProductStock) AS ProductStock FROM products"; if I want to return $ProductStock as the value?This one. The "AS" gives it an alias (or shortcut) to make it easier to find in mysql_fetch_array etc. --Postgresql & php tutorials http://www.designmagick.com/ --PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php