[ciapug] Working with dates, again.

David Champion ciapug@cialug.org
Tue, 28 Sep 2004 14:36:36 -0500


I think what you're looking for is combining a count with a group by...

i.e.

select id, count(id) as my_count from my_table group by date

... but you'll need to use some date functions to get it by week. Here's 
the mysql manual page on date fn's:

http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html

The ciapug.org domain is apparantly on "client hold" mode. John R... can 
we get that updated to a "live" mode. LMK what the cost is and we'll 
cover it.

-dc

Chris Hettinger wrote:

> Just looking for good resources on working with dates in PHP. I've 
> searched a couple PHP script sites but haven't found any good examples.
> 
> I am working on a report that will display a count of forms processed. 
> Initially the results will be split by Month, then within the month I 
> need counts by week. Like the following:
> 
> September 04
> week 1: X
> week 2: X
> week 3: X
> week 4: X
> 
> August 04
> week 1: X
> week 2: X
> week 3: X
> week 4: X
> 
> ... so on
> 
> Any suggestions on resources to look up coding examples would be 
> appreciated.
> 
> Thanks in advance,
> -ch
> 
> PS. mail routing to ciapug@ciapug.org are not going through, what's up? 
> Domain need to be renewed?