PHP date selection

Status
Not open for further replies.

clm100

Ars Legatus Legionis
13,874
Subscriptor
I've got a confusing bit of php code facing me right now... I need to display different announcement type things depending on the day. I've gotten it to work perfectly for today, now I need to get it to work for other days...
code:<HR>
Code:
if (!$time) {
     $time = CURRENT_DATE;
}
and in the mySQL search is selects "WHERE(day=$time)" But, when I specify a date in the correct format, it doesn't work. (An example would be script.php?time=2002-01-17). The field day is in a mySQL database as a date field. And I definitly need to learn to choose better variables...

Anyone know what to do?
 
Status
Not open for further replies.