RE: [PHP] Count totals(might be 0T)

From: Date: Thu, 21 Apr 2005 22:55:02 +0000
Subject: RE: [PHP] Count totals(might be 0T)
Groups: php.general 
Request: Send a blank email to php-general+get-213615@lists.php.net to get a copy of this message
Ryan A <mailto:ryan@coinpass.com> 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.

« previous php.general (#213615) next »