Hello Everyone!
I am trying to select records where the date is between todays date and 7 days from now.
I know i have to consider year, month and day but I can't figure out how to do it. I can do it based on month:
$today=date("Ymd", mktime(0,0,0, date(m), date(d),date(Y)));
$nextDate=date("Ymd", mktime(0,0,0, date(m), date(d)+1,date(Y)));
IN my SELECT Statement:
AND (month(game.GameDate) >=month($today) || month(game.GameDate) < month($nextDate))
in my database GameDate is in the format of 2001-01-23. Do I have to somehow strip the date of the "-" in the select statement? I don't know how that would be done though.
I think I somehow have to say
"SELECT *
FROM ITGame
WHERE ....
AND (GameDate>=$todayDate && GameDate<=$dateInSevenDays)";
Please help...
Thanks for your time. Any help is greatly appreciated!