We help IT Professionals succeed at work.
Get Started

mysql show next 3 dates after todays date

mrroy69
mrroy69 asked
on
226 Views
Last Modified: 2013-12-12
I'm trying to diplay the next three dates greater than todays date in DESC order. The code below gives me:

10-25-2009

10-18-2009

10-04-2009

09-27-2009

09-26-2009

09-20-2009

09-07-2009

09-06-2009

However the next three dates from today are:

09-20-2009

09-07-2009

09-06-2009

I tried LIMIT 3 but this only shows the last 3 and not the next 3. What do I do?
$todaysDate=date("Y-m-d");
SELECT * FROM table WHERE eventdate > '$todaysDate' ORDER by eventdate DESC

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE