Date base of dates - what is the closest date to the current date?
Posted on 2004-08-04
Hi I am using a sort date function in PHP like this:
$result = mysql_query("select * from shows ORDER by showdate");
Now what I need to do is a comparison of the current date to the dates in my data base.
I need to know the number of the row that is closet to the current date. Like this
todays date = 08.04.04
The number of the row that is closest to the curret date is "2" (08.03.04)
I need this number so I can pass it on to a data grid so it will automatically select the date closest to the current date. Can this be done?