Sort a while loop ?
| From: | Dave Carrera | Date: | Fri, 02 Jan 2004 15:12:49 +0000 |
| Subject: | Sort a while loop ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173633@lists.php.net to get a copy of this message | ||
Hi List,
How can I sort a while loop or do something before it to achieve the
following?
I have a MySql result fetching something like this:
Id Name Number
1 Bob 34567
2 Ben 234
3 Jeff 4567
4 Dave 2345
But I want to sort the while loop by Number Highest first so the result
looks like this:
Id Name Number
1 Bob 34567
2 Jeff 4567
3 Dave 2345
4 Ben 234
I have looked at sort() asort() and others in the manual and either I am
doing something wrong (which is more than likely) or a while loop is not
what I need to use to achieve this.
Thank you in advance for any help
Dave C
P.S: Happy New Year to you all.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.556 / Virus Database: 348 - Release Date: 26/12/2003