Thursday, 19 September 2013

Mysql query based on date?

Mysql query based on date?

I have a table like this
id | date | content
1 | 09-16-2013 | content 1 here
2 | 09-23-2013 | content 2 here
3 | 09-30-2013 | content 3 here
I would like to display the content for a week from that date. For
example, the first content should start on 9/16/2013 and then show until
9/22/2013 mid night. then on next day, it changes to the content 2. Same
way,when I am on content 2, I want to display like "previous week content"
and then show just the previous ones..I think I can do this by checking
the current date and then anything below that has to be displayed.
I am not very good at these kind of mysql queries, please advise!
Regards

No comments:

Post a Comment