title: how to create a rank system
body: <p>I have a user table with <code>user_score</code> column in view side I want to show every user rank and score and 2 people before/after him.</p>
  
  <p>how can I implement this with MySQL or PHP with minimum execution time? </p>
  
  <p><strong>example</strong></p>
  
  <pre><code>+-----------+------------+
  | User_id   | Score      |
  +-----------+------------+
  | 1         | 12258      |
  | 2         | 112        |
  | 3         | 9678       |
  | 4         | 689206     |
  | 5         | 1868       |
  +-----------+------------+
  </code></pre>
  
  <p>for example my <code>user_id = 3</code>. I want to show like this</p>
  
  <pre><code>                    you
                     9678    
  
   user befor you               user after you
      12258                            1868       
  </code></pre>