php/mysql query problem
Posted: Mon Jan 24, 2011 3:52 pm
In the code below, I get a null value. If I echo $month_start and $upcoming_events_end, I get 2011-01-01 and 2011-01-31, so it appears that the correct data is being passed. Any idea what might be wrong here?
Code: Select all
$month_start = date('Y') . '-' . date('m') . '-01';
$query = "SELECT * FROM wp_calendar WHERE event_category = '4' BETWEEN '$month_start' AND '$upcoming_events_end'";
$result = mysqli_query($mysqli, $query) or die(mysqli_error());
$cal_banner = mysqli_fetch_row($result);