Re: Count totals (might be 0T)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux