Re: php to generate statiscs
| From: | Rodrigo Peres | Date: | Mon, 03 Jun 2002 15:34:05 +0000 |
| Subject: | Re: php to generate statiscs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100408@lists.php.net to get a copy of this message | ||
Does anybody knows the link to this article or other that treats something
like this. I couldn;t find it in devshed.
Rodrigo
on 6/2/02 3:57 PM, John Holmes at holmes072000@charter.net wrote:
> Look into cross-tab queries (I think that's what they are called). There
> is a good article on Devshed.com about it. You can do a query like this
>
> SELECT SUM(IF(Gender='M'),1,0)) AS Male, SUM(IF(Gender='F',1,0)) AS
> Female FROM table
>
> That'll give you two columns, one named Male, one named Female, in the
> result set. The result set will have one row, containing the number of
> males in the database in the Male column, the number of females in the
> database in the second.
>
> You could probably do the majority of your "statistic" queries this way.
>
> ---John Holmes...
>
>> -----Original Message-----
>> From: Rodrigo Peres [mailto:rperes@mac.com]
>> Sent: Sunday, June 02, 2002 2:02 PM
>> To: php-general@lists.php.net
>> Subject: [PHP] php to generate statiscs
>>
>> Hi list,
>>
>> Sorry if this is a off-topic, but I really don't know where to begin.
> I
>> have a mysql database with about 20.000 records, now I need to build a
>> statistics panel to show for example how many of this record are male,
>> female, lives in determinated city, school graduation etc, everything
>> grouped by sex and alone too, present the respectives percentages
> etc...
>> How do I begin??? Can someone help??
>>
>> thank's in advance
>>
>> Rodrigo Peres
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--