Requesting data from a certain month saved with time()

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
keveh
Forum Commoner
Posts: 27
Joined: Mon Aug 08, 2005 5:50 am

Requesting data from a certain month saved with time()

Post by keveh »

I am producing some code to construct a blog.

On the right hand side of the page I want to have an archive where it is listed in months, eg:

September 06
August 06
July 06

and so on.

When a blog is posted, the time is was posted is saved using the php function time()

When somebody clicks on a certain month I need the page to bring up all of the posted blogs which were posted in that month.

How would I query the database to find the blogs from a certain month, eg September?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

FROM_UNIXTIME() and EXTRACT( YEAR_MONTH FROM .. ) that result could be useful here.
Post Reply