php script help!!!!

We have a website running clan matches with a program we brought form have edited alot of the code but we have hit a snag,The problem we have run into is the orignal program ran like a ldder e.g if i play a person 3 places above me and win i replace that player but we have changed the code so that a win is eqall to 3 points the problem we have is it calls the players back but in no order e.g if there are 3 players at the top with 9 points we would want it to list in order by wins then losses (so if i have 3 wins no losses and the others have 3 wins 1 loss and the other has 3 wins 3 losses)i would be top because i have the least amount of losses but at the moment it just puts them in random order but in order of points .Any help will be much welcomed :D
ORDER by $sortby limit $start,$stop"); this is from our $query
added is a bit of code that might help

sorted now thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service