Why not just have SQL server to do that? That's exactly the kind of thing it excels at! AND it's much quicker than switching to PHP for sorting.
get the "top" scorer
Code:
SELECT userid FROM table MAX(score);
second highest
Code:
SELECT userid FROM table ORDER BY score ASC LIMIT 1,1;
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
« Reply to PHP to calculate next number in sequence from MySQL table ?