Php, mysql date issues

I am building a site for a band. I want to have a section which lists the upcoming shows they will be playing. The band will enter the dates in the mm-dd-yy format.

I’m having a few issues:

  1. As I understand it MySQL formats dates as yyyy-mm-dd. How do convert the mm-dd-yy to the necessary yyyy-mm-dd?

  2. On one page i will have a table in which i want to list the next 5 shows that they will be playing. I’m a little confused as to how I query only the shows that have dates later than the current day.

  3. Similar to 1. When i DO display the dates how to i make them appear in mm-dd-yy format?

Thanks in advance for any help!

I am working on this EXACT PROBLEM! The code right there works… the only problem is, it is ordering alphabetically (changed the format of date so that it executes as “Monday, March 21, 2006”.

I have several dates following, but they are out of order. They are ordering alphabetically. I need them to order by their actual dates.

Hurry, this problem is very important.

//sky

ill do my best :wink:

$query= "SELECT gig, DATE_FORMAT(gig_date,'%W, %M %d, %Y') AS myDate 
FROM myTable 
WHERE gig_date >= NOW() 
ORDER BY gig_date DESC 
LIMIT 5";
 
...
 
while ($Res = mysql_fetch_assoc($result)) 
{ 
echo $Res['gig']." - ". $Res['myDate']."<br>";
} 

Output:
Gig1 - Wednesday, March 21, 2007
Gig2 - Monday, March 19, 2007
Gig3 - Monday, March 12, 2007
etc…