Re: Help for code to 'sort list' please
| From: | EastLothianDirectory | Date: | Mon, 02 Feb 2004 20:33:52 +0000 |
| Subject: | Re: Help for code to 'sort list' please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176612@lists.php.net to get a copy of this message | ||
Thank you for replying again but I have already been on the Mysql.com website
and although I did ascertain the correct syntax ie
ORDER BY date_day, date_month, date_year desc
ORDER BY date_day, date_year, date_month desc
ORDER BY date_month, date_day, date_year desc
ORDER BY date_month, date_year, date_day desc
ORDER BY date_year, date_day, date_month desc
ORDER BY date_year, date_month, date_day desc
None of them work mainly because the months get listed alphabetically and not IN
ORDER. For example AUGUST is listed as the first month because it started with 'A'
The year and day being integers were listed correctly.
Now do you see the problem. This is why Mysql.com was no good so I came to PHP for
help.
Thank you in advance to anyone ?? that can help.
---- Original Message ----
From: John Nichel
Date: Mon 2/2/04 19:43
To: php-general@lists.php.net
Subject: Re: [PHP] Help for code to 'sort list' please
EastLothianDirectory wrote:
> Thank you for reply. I already have 'ORDER BY year desc'.
>
> But as I mentioned how do I get the months and day in order too on the same list.
>
> Thank you in advance
<snip>
Read the documentation for ORDER BY in MySQL. You can sort on multiple
columns. Basically, you can 'ORDER BY year, month, day DESC' (my syntax
may be off), and it order it by the year first, then like years will be
ordered by month, etc.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php