Skip to main content
Inspiring
November 28, 2007
Answered

PHP MySQL filter by todays date

  • November 28, 2007
  • 1 reply
  • 383 views
This one should be simple. I want to filter events from a database and not return any entries who's date (one of the fields) is before the current date (I do want it to show events that equal the current date). I'm sure theirs a simple answer for the MySQL code, but I'm not sure how and how to pull todays date from the server. Thanks from a novice...
This topic has been closed for replies.
Correct answer Justin_from_Indiana
Perfect David, thanks. I knew there would be a simple answer... Just need to find some time to better educate myself!

1 reply

Inspiring
November 28, 2007
Justin from Indiana wrote:
> This one should be simple. I want to filter events from a database and not
> return any entries who's date (one of the fields) is before the current date (I
> do want it to show events that equal the current date).

SELECT column1, column2, column3
FROM myTable
WHERE theDate >= CURDATE()

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Justin_from_IndianaAuthorCorrect answer
Inspiring
November 28, 2007
Perfect David, thanks. I knew there would be a simple answer... Just need to find some time to better educate myself!