SergeantFlash Posted August 11, 2008 Share Posted August 11, 2008 I have this code inside a php file: $query = "SELECT * FROM {$table} order by kills desc LIMIT 0,12"; This code orders the rows in the table from highest to lowest by kills. For example: Name | Kills --------------- Bob 300 Joe 230 Mike 50 Rob 50 However, some players would get the same amount of kills, how can I make it so, out of the players with the same kills, it orders them from newest to oldest (order them by emp_id, which is a variable I made that automatically increments by one, so the newest submission would have the higher number). So the table would look like this (since Rob was the newest person to play the game): Name | Kills --------------- Bob 300 Joe 230 Rob 50 Mike 50 Any help is appreciated. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Barand Posted August 11, 2008 Share Posted August 11, 2008 ORDER BY kills DESC, id DESC Quote Link to comment Share on other sites More sharing options...
SergeantFlash Posted August 11, 2008 Author Share Posted August 11, 2008 That works great! Thanks a lot Barand!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.