Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP MySQL filter by todays date

Explorer ,
Nov 27, 2007 Nov 27, 2007
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...
TOPICS
Server side applications
379
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Nov 28, 2007 Nov 28, 2007
Perfect David, thanks. I knew there would be a simple answer... Just need to find some time to better educate myself!
Translate
LEGEND ,
Nov 28, 2007 Nov 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 28, 2007 Nov 28, 2007
LATEST
Perfect David, thanks. I knew there would be a simple answer... Just need to find some time to better educate myself!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines