Re: sorting results in PHP
| From: | Erik Price | Date: | Mon, 17 Mar 2003 16:41:24 +0000 |
| Subject: | Re: sorting results in PHP | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139976@lists.php.net to get a copy of this message | ||
bill wrote:
Hi André, Sorting like that doesn't get it sorted by date. Each row has a lot of fields. It actually needs to be sorted three times by three fields, Year, Month, and Day. Because the query uses a GROUP BY statement, I can't sort it in the query.MySQL offers a DATE column type. You can extract a day, year, or month from this, without having to maintain three separate tables, using DATE_FORMAT. You can also sort by DATE in the query. Would this not be better for your situation? Erik