RE: [PHP] PHP and MySQL sorting using COUNT
| From: | Rich Gray | Date: | Wed, 13 Nov 2002 13:54:45 +0000 |
| Subject: | RE: [PHP] PHP and MySQL sorting using COUNT | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124215@lists.php.net to get a copy of this message | ||
try '... ,count(*) as count ...' then you should be able to reference it as
$row['count']
HTH
Rich
-----Original Message-----
From: ed@home.homes2see.com [mailto:ed@home.homes2see.com]
Sent: 13 November 2002 13:44
To: php-general@lists.php.net
Subject: [PHP] PHP and MySQL sorting using COUNT
I'm sorting records using COUNT with the following mysql command
$result = mysql_query ("SELECT company_name, agent_name, count(*) FROM
$cur_listings GROUP BY company_name, agent_name");
Running this in MySQL does exactly what I need it to do but how do I echo
the COUNT portion of the array? I know the company_name would be
$row['company_name'] and agent_name is $row['agent_name'];
Thanks,
Ed Curtis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php