RE: [PHP] php to generate statiscs

From: Date: Sun, 02 Jun 2002 18:57:29 +0000
Subject: RE: [PHP] php to generate statiscs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100325@lists.php.net to get a copy of this message
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

« previous php.general (#100325) next »