Re: Assistance Urgent.
| From: | DL Neil | Date: | Wed, 12 Dec 2001 15:20:41 +0000 |
| Subject: | Re: Assistance Urgent. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14962@lists.php.net to get a copy of this message | ||
Barry,
> We have a field named: related_discipline which contains 1 of 12 different disciplines. So for
> example we have
Rail which could be in the field, or Utilities and so on.. what we need to do is know how many of
each there are
in the database, I am still developing my knowledge of PHP and MySql so help would be appreciated.
We need to be
able to display the 12 different options that could be in that field in the database and how many
entries there
are for each option.
=check out the online manual.
The function required is appropriately enough called COUNT(). In order to get the count to apply to
a particular
"discipline" use the GROUP BY and retrieve twelve counts (from one SELECT query).
=dn