Jump to content

Where statement to select by date problem


Recommended Posts

Hi Newbie question sorry.I have a mysql database field called "event_start_date" Format is DATEI want use a select statement to get all records where event_start_date is greater than or equal to today.So (using php) I have set $current_date = date(Y-m-d);then tried the select statement SELECT * FROM event WHERE event_start_date >= $current_date ORDER by event_start_dateI doesn't give me an error but gives me all records including those with a date before todays date. Sorts by date order OKBecause it sorts ok I think I must be close, but what have I done so it is not selecting future events only.Many thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...