Re: Count problem
- From: Andy Hassall <andy@xxxxxxxxxxx>
- Date: Mon, 20 Jun 2005 22:11:36 +0100
On Mon, 20 Jun 2005 21:06:21 GMT, Wayne Delia <wmd@xxxxxxxxxxxxxxx> wrote:
>Bryan wrote:
>> I've been trying to work out a problem but I'm having no luck. I have
>> field in my table for area and I need to count the number of matches
>> and assign a variable for each one.. this is what I have but it doesn't
>> work.. any ideas?
>>
>> $testcount = mysql_query("select area, count(area) as newcount from rea
>> group by area order by area");
^^^^^^^^^^^^^
>
>MySql queries involving count(columname) require a GROUP BY clause, for
>starters.
Like the one he's already got? :-)
--
Andy Hassall / <andy@xxxxxxxxxxx> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
.
- Follow-Ups:
- Re: Count problem
- From: Wayne Delia
- Re: Count problem
- References:
- Count problem
- From: Bryan
- Re: Count problem
- From: Wayne Delia
- Count problem
- Prev by Date: Re: Count problem
- Next by Date: Re: Count problem
- Previous by thread: Re: Count problem
- Next by thread: Re: Count problem
- Index(es):
Relevant Pages
|
|