show results during a certain time frame

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kevrelland
Forum Commoner
Posts: 73
Joined: Mon Jan 08, 2007 7:41 am

show results during a certain time frame

Post by kevrelland »

I want to display some date sensitive information i.e. press releases
i want them to be displayed and not display according to the dates set in fields of the mysql db.
can anybody give me some pointers on where to look on how to do this
cheers
kev
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Store the lower (and upper) date limits in the database - I would use timestamps for this. Then select * from your_table where start_date<now AND end_date>now.
kevrelland
Forum Commoner
Posts: 73
Joined: Mon Jan 08, 2007 7:41 am

Post by kevrelland »

cheers for the info
kev
Post Reply