Forum Moderators: coopster
m/d/y
now the variable that equals that would look like this
$today = date("n/j/Y");
so I am using explode to divide it into an array with the / but I am not to sure how I can compare them, what I want is if a date from the db is within the next 7 days I would like it displayed. So today is the 30 anything up to the 6th should be displayed, now, this prolly means I have to input all the days of all the months etc, but I have never written a script this complex before (on the surface it looked easy lol)
So if someone could point me in the right direction I would appreciate it.
First, if you can, you should try to use the standard DATE column type and it's expected format. If you can't you are going to have to format the date prior to building the query statement in order to get the calculation to return the expected results.
As an example, here it is from the MySQL manual pages:
Although MySQL tries to interpret values in several formats, dates always must be given in year-month-day order (for example, '98-09-04'), rather than in the month-day-year or day-month-year orders commonly used elsewhere (for example, '09-04-98', '04-09-98').
Just a heads up...