[snip]
For example, if I create a record set of all male employees regardless
of eye color and then I want to create a table showing the totals of
people of each eye color.  Is there a way to do this with out creating
several different recordsets.
[/snip]

Yes, you handle it in the query;

$sql = "SELECT COUNT(eyeColor) AS colorCount, eyeColor FROM theTable
WHERE sex = 'male' GROUP BY eyeColor ";

You can also do a cross-tab query;

$sql = "SELECT eyeColor, ";
$sql .= "SUM(IF(sex = 'male', 1, 0)) AS Guys, ";
$sql .= "SUM(IF(sex = 'female', 1, 0)) AS Gals ";
$sql .= "FROM theTable ";
$sql .= "GROUP BY eyeColor ";

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to