Is it possible to use an if statement in a MySQL query in a similar what I'm showing? I want to grab some information for upcoming events(not ones with previous dates).
ini_set('date.timezone', 'America/New_York');
echo $timestamp = date('Y-m-d');
$sql = "select eventID,eventTitle,eventDate from events where eventLocationID = $locationID AND (eventDate > $timestamp) ORDER BY eventDate ASC";
edit - the sql statement isn't filtering out dates prior to today (it's displaying everything).
For example, I'm echoing the timestamp just to be sure it's setting properly. In my table I entered two dates, one in january and one today.
So here is the output
2012-05-31 //timestamp, not part of results. just for reference
2012-01-10 //first result, however it shouldn't display
2012-06-22 //this should be the only result that displays