Fifth Leg
Fifth Leg

Reputation: 1

Select all dates after a certain date

I'm trying to get all dates after a given date in MySQL, but the results are the exact opposite of what I want.

$sql = "SELECT DISTINCT(DRFDate) FROM tblDRF WHERE DRFDate > $DepartureDate";

But this is giving me all the dates before $DepartureDate

Upvotes: 0

Views: 332

Answers (1)

Kingsley Uchenna
Kingsley Uchenna

Reputation: 700

Your need to put $DepartureDate in a single quote.

$sql = "SELECT DISTINCT(DRFDate) FROM tblDRF WHERE DRFDate > '$DepartureDate'";

Upvotes: 1

Related Questions