Jump to content

How do I filter out dates in PHP?


lpxxfaintxx

Recommended Posts

I have a database of events that have a table 'date' that has dates stored in the format "Month Day, Year." How would I make make a query that only selects dates that are in the future, and not past?

 

For example, today is February 9, 2009. Let's say I have the following rows with the 'date' tables:

 

January 4, 2009

January 31, 2009

February 21, 2009

February 26, 2009

 

How would I make it so that I only get "February 21, 2009" and "February 26, 2009," since they are UPCOMING, and not in the past?

 

Hope that makes sense. thanks

Link to comment
Share on other sites

Thanks, I will look into that. What is the date format for MySQL? Is it YYYY-MM-DD?

 

Also, when I echo out the date in PHP, how do I make the date more "user-friendly?" IE, how do I make it show up as "February 24, 2009" instead of "2009-02-24"

 

After I change the column to date, then what do I do? Any query to get the dates in the future?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.