Re: Need to get total number from query!
| From: | Matthew Ballard | Date: | Fri, 15 Dec 2000 08:06:58 +0000 |
| Subject: | Re: Need to get total number from query! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30469@lists.php.net to get a copy of this message | ||
Without a where clause, I believe that would return all the records, just in three rows with counts for each type, in which case you wouldn't need to group it, but if you wanted to do it that way for some reason, the only way I can think of to get a sum of the results is just to loop through the results and sum the column in the loop.
Matthew
At 10:24 PM 12/14/2000 -0800, you wrote:
Just a quick question. I have a query as such: SELECT q9 AS names, count(*) AS numbers FROM table GROUP BY q9 ORDER by names desc; this gives me something like: ------------------------ ans1 : 10 ans2 : 20 ans3 : 30 ------------------------ what i would like is a way to get the total of those 3 figures as a variable and plug that in at the bottom... is there a quick way? thanks! Sunny __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net