Wouldn't count(sku) work?
-----Original Message-----
From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 3:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] COUNT(*) Output Question
Hey-
I'm query my mySQL database to see how many of each Sku has been
ordered. I am doing my query as:
$count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku");
But my question is how do I use PHP to output the COUNT(*) results? When
I run the command when I'm logged into mySQL I get the following:
mysql> select sku, count(*) from orders group by sku\g
+----------+----------+
| sku | count(*) |
+----------+----------+
| 10001 | 1 |
| 10001a | 1 |
| 10003 | 2 |
| 10005 | 1 |
| 10011 | 1 |
+----------+----------+
I just can't figure out a way to output that Count(*) column into
something HTML friendly...any help or thoughts on this would be
appreciated!
TIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php