Re: [php]: monthly statistics

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

 



On 2005-09-18, John Taylor-Johnston <John.Taylor-Johnston@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
> Where could I find a monthly statistic plugin that can take my 
> `StampDate` field and generate monthy graphs of my primary key `id`?
> I'm sure I,m not the first to ask? ;-)
>
> CREATE TABLE `counter` (
>   `id` int(10) NOT NULL auto_increment,
>   `StampDate` date NOT NULL default '1999-12-31',
>   PRIMARY KEY  (`id`)
> ) TYPE=MyISAM AUTO_INCREMENT=26050 ;
>

All you need to do is SELECT .. GROUP BY YEARMONTH(StampDate) and you're
ready to go..

-- 
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>

-- 
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