sorting results in PHP
| From: | bill | Date: | Tue, 11 Mar 2003 18:51:31 +0000 |
| Subject: | sorting results in PHP | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26253@lists.php.net to get a copy of this message | ||
I have a query that returns results including the fields Year, Month, and Day
that I want to sort by date.
Because of the nature of the query (it includes a GROUP BY statement), I cannot
sort it in the query.
How can I sort the results?
I tried to use asort() while designating the field but that didn't work.
while ($crow=mysql_fetch_array($cresult)) {
$therow[]=$crow;
}
asort($therow["Year"]);
reset($therow);
asort($therow["Month"]);
reset($therow);
asort($therow["Day"]);
reset($therow);
ideas?
kind regards,
bill