Re: HIgh score not up to scratch
| From: | Chris | Date: | Thu, 16 Mar 2006 02:00:48 +0000 |
| Subject: | Re: HIgh score not up to scratch | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231991@lists.php.net to get a copy of this message | ||
Mark wrote:
Any help Here:
At the moment this shows a USERNAME-COMPETITION and POINTS for a user with the highest points out of many competitions.
The USERS also have a second points field (acc_margin) where lower score is better.
So my problem is that i need to show the highest scoring user (by points) then if there is another user with the exact same points then the user with the lowest (acc_margin) is shown.
HERE IS THE TABLE:
Field Type Null Default
id int(11) No
user_id int(11) No 0
comp_id int(11) No 0
username text No
points int(11) No 0
amt float No 0
margin int(11) No 0
acc_margin int(11) No 0
****************************
I had a similar question earlier that i was helped with but i cant seem make it work here:
(here it is)
SELECT * FROM leaderboard WHERE comp_id = $comp_id ORDER by points DESC, acc_margin ASC
*******************************
What was wrong with this result? ie what did it show and what did you expect it to show? This looks right to me.
--
Postgresql & php tutorials
http://www.designmagick.com/