Re: Finding news items by Month
| From: | John W. Holmes | Date: | Thu, 29 Jan 2004 14:17:54 +0000 |
| Subject: | Re: Finding news items by Month | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176204@lists.php.net to get a copy of this message | ||
From: "Michael Hill" <mike@holler.co.uk>
> I have a bunch of news items in a database. All of them have a date
> associated with them. I am trying to make a function that queries the db
> and tells me which months have newsitems in them(if any at all), and how
> many each of the months have.
You should mention what database you're using when you ask questions like
this. Try:
SELECT MONTH(date_column), COUNT(*) FROM table GROUP BY MONTH(date_column);
---John Holmes...