Page 1 of 1

Trouble getting dates within range

Posted: Wed Jan 19, 2011 10:02 am
by someguyhere
Can anyone tell me if there is something wrong with this statement? It's not outputting anything. In this particular case, the values for the variables are:

$current_date = 2011-01-19
$current_events_end = 2011-01-31

Code: Select all

$query = "SELECT * FROM wp_calendar WHERE event_begin BETWEEN $current_date AND $upcoming_events_end";

Re: Trouble getting dates within range

Posted: Wed Jan 19, 2011 10:29 am
by someguyhere
Solved it:

Code: Select all

$query = "SELECT * FROM wp_calendar WHERE event_begin BETWEEN '$current_date' AND '$upcoming_events_end'";