Re: Count totals (might be 0T)

From: Date: Thu, 21 Apr 2005 22:49:32 +0000
Subject: Re: Count totals (might be 0T)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-213612@lists.php.net to get a copy of this message
Hi, Friday, April 22, 2005, 8:03:06 AM, you wrote: RA> Hi again, RA> Am faced with a new problem (either that or working straight 10 hours is RA> catching up!) RA> Heres my table (easy to figure out so i wont waste your time explaining the RA> fields): RA> cno, RA> date_added, RA> pic_name, RA> pic_size_kb, RA> pic_desc_text, RA> pic_category RA> the way i am displaying the data is like this (thanks to Phillip and Andy RA> from this list) RA> __________________________________ RA> category here 2pics, 90kb | RA> --------------------------------------------- RA> | pic-here | <pic_desc_text> | RA> | pic-here | <pic_desc_text> | RA> __________________________________ RA> category here 2pics, 160kb | RA> --------------------------------------------- RA> | pic-here | <pic_desc_text> | RA> | pic-here | <pic_desc_text> | RA> --------------------------------------------- RA> When I sql the DB I call it like this: select picture_name<,more fields>> from <table> where cno=<x> order by category. RA> Any ideas as to how i get how many pics per category and size per category? RA> I'm not sure if its a PHP thing or a MySql thing... RA> Last problem for the day...then i hit the sack! RA> Thanks in advance, RA> Ryan Something like SELECT COUNT(pic_name) as pic_count, SUM(pic_size_kb) as pic_total FROM pic_table GROUP BY pic_category -- regards, Tom

« previous php.general (#213612) next »