Ryan A <mailto:ryan@xxxxxxxxxxxx> on Thursday, April 21, 2005 3:03 PM said: > When I sql the DB I call it like this: select picture_name<,more > fields> from <table> where cno=<x> order by category. > > Any ideas as to how i get how many pics per category and size per > category? I'm not sure if its a PHP thing or a MySql thing... By either running a query for each category grabbing the data you want. Or by grabbing the data you want in the initial query and adding it all up BEFORE you start to do you display logic. So the second option would be: 1. Get all the data. 2. Loop through all the data creating the tally(s) you want. 3. Loop through the data again creating your visual gropings and throwing in the tally(s) you created earlier. Try both options and time them. Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php