...

View Full Version : Ordering a list of data



Badman3k
09-18-2003, 09:54 PM
I have list of data on one of the pages of my website. The default order is by the "points" which is great but unfortunately it orders it in the wrong direction i.e. 0 comes before 12. Is there a simple piece of PHP I can "call" when the page opens that will reorder the data to be the "correct" direction i.e. 12 comes higher in the list than 0.

Any help would be greatly appreciated.

Many thanks in advance

raf
09-18-2003, 10:04 PM
Some of us have psychic powers but some relevant code or additional information might help.

If you select the data from a db, then you should do the ordering in sql.
something like
$sql ="SELECT var1, var2, points FROM table ORDER BY points desc"

raf
09-18-2003, 10:22 PM
Please do not crosspost
http://www.codingforums.com/showthread.php?s=&threadid=26532

Please read
http://www.codingforums.com/postguide.htm


I suppose this hread may be closed ?

Spookster
09-19-2003, 12:09 AM
That is correct.

Closing...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum