This is related to a previous enquiry here.
We have a web site for racing cars, and it shows the Race Dates.
What we want to do is to show the date of the next Race Meeting, based on today's date.
ie. today is 19th August 2010.
There are 20 dates in the database going from 15th July 2010 through to 30 October 2010.
There might be a date of 25th August 2010 in there.
How do I make it pic out that date from all the others? I would have thought it's to do with converting the date to an str*, and then some maths. But am not quite sure how to go about this one.
Can you show the next available date from the database?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Can you show the next available date from the database?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Can you show the next available date from the database?
If you simply store the dates then a mere
in your SQL should be enough.
Code: Select all
...WHERE datefield > "today's date"...-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Can you show the next available date from the database?
Ohhh, and in theory then you can order them by date, and LIMIT ? Like you do with Page Numbering?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.