Re: Ordering by dates
| From: | Vijest.com | Date: | Sat, 11 Nov 2000 07:55:52 +0000 |
| Subject: | Re: Ordering by dates | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24766@lists.php.net to get a copy of this message | ||
There are also many MySQL date/time functions, so you might find it usefull to look at MySQL manual.
I think the best way to do that is using TIMESTAMP.
lancelot_
At 23:18 2000.11.10 -0600, 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.
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net