title: PHP MySQL Highscore table
body: <p>Im joining 3 tables to present a table with users highest score</p>
  
  <p><b>My tables</b></p>
  
  <p>game_log:</p>
  
  <pre><code> ---ID---user_ID---score---time---
   |   1      52      567     10   |
   |   2      53      641     13   |
   |   3      52      465     8    |
   |   4      53      451     14   |
   --------------------------------- 
  </code></pre>
  
  <p>users:</p>
  
  <pre><code> ---ID---name---countyid---
   |   52  Dave      1      |
   |   53  John      2      |
    ------------------------
  </code></pre>
  
  <p>county:</p>
  
  <pre><code>  ---countyid---countyname---
    |      1    Orange wichit |
    |      2    Orange clemts |
     --------------------------
  </code></pre>
  
  <p>SQL:</p>
  
  <pre><code>SELECT * FROM game_log 
  INNER JOIN users ON game_log.user_ID=users.ID 
  INNER JOIN county ON users.countyid=county.countyid 
  ORDER BY game_log.score DESC , game_log.time LIMIT 20";
  </code></pre>
  
  <p>Above code gives me this result:</p>
  
  <pre><code>Rank---Name--------County------Score---Time
  1      John     Orange clemts   641     13
  2      Dave     Orange wichit   567     10
  3      John     Orange clemts   465     8
  4      Dave     Orange wichit   451     14
  </code></pre>
  
  <p>My problem is that I want the highscore table to display the top 20 users with the highest score, not the 20 highest scores.</p>
  
  <p>Like this:</p>
  
  <pre><code>Rank---Name--------County------Score---Time
  1      John     Orange clemts   641     13
  2      Dave     Orange wichit   567     10
  </code></pre>
  
  <p>Need som help with this, not familiar with joining tables ;-)</p>