Page 1 of 1

display a range of DATES

Posted: Wed Mar 30, 2011 9:03 pm
by miramichiphoto
Fellow coders;

I want to display a schedule, but only between certain dates. The events get scheduled by users, using a php calendar function that inserts dates into the db that look like this: 2100-12-27. The db column type is "date".

My question is how would I display events sorted by date, with a range of 1 week before today's date to one week after today's date? (I have been looking at examples online, but MAN it is confusing.)

Cheers.

L

Re: display a range of DATES

Posted: Wed Mar 30, 2011 10:28 pm
by fugix
I would imagine that you would use a timestamp incorporated into yor MYSQL query function WHERE $date < time()+seconds AND $date > time()-seconds...something like that