Question about mySQL ordering
#1

I'm making a leaderboard. It's for the Kickstart Stadium. The two affecting values are the amount of points you got (0-60) and the time. I need to factor these BOTH in to the ordering, so if two people got 50 points, the one with the shortest time is higher on the leaderboards.

I already know how to do ordering, just not sure how to do both because one is asc and one is desc.

Thanks.
Reply
#2

You could try something similar to this, assuming you want it to sort it by highest points and shortest time.

pawn Код:
mysql_query("SELECT * FROM table_name ORDER BY points DESC, time ASC");
Reply
#3

Works great, thanks.

I get these weird errors in phpMyAdmin when I send the query though:

unknown table status: TABLE_TYPE
unknown table status: TABLE_TYPE
unknown table status: Comment
unknown table status: TABLE_TYPE
unknown table status: TABLE_TYPE
unknown table status: TABLE_TYPE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)