Re: Ordering by dates

From: Date: Sat, 11 Nov 2000 06:06:17 +0000
Subject: Re: Ordering by dates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24762@lists.php.net to get a copy of this message
On Fri, 10 Nov 2000, Tyler Longren wrote: > Hey list, > > How would I order the following by date. The dates are in mm-dd format > (Eg: 11-10). This is a problem when trying to order the events by their > date. Here's a snippet of mysql table: > > sport location date time opponent > -------------------------------- > Football Maxwell 9-20 7:30 Colo-Nesco > > Football Baxter 10-13 7:30 North Polk > Football Collins 10-1 7:30 West Marshall > > > Now, is there anyway I could order these by date. A simple > mysql_query("SELECT * FROM sports WHERE sport = '$sport' ORDER BY date > ASC"); > doesn't exactly work. I suppose it's because of the date format. Would > this be easier to convert the dates to timestamps? Any ideas would be very > very much appreciated. > > Thanks! > Tyler Longren > > Just for some background info, this is a project for school. It's a > listing of sporting events for my school. > Not TIMESTAMP, but DATETIME. Two columns for the price of one! -- Ignacio Vazquez-Abrams <ignacio@openservices.net>

« previous php.general (#24762) next »