title: Row position in MySQL
body: <p>I was looking <a href="https://stackoverflow.com/questions/1895110/row-number-in-mysql">here</a>, but can't find the answer to my question. </p>
  
  <p>Need to get a list of objects from MySQL, for e.g.:</p>
  
  <pre><code>+-----------------------------+
  + id | username | password    +
  +-----------------------------+
  +  1 | User1                  +
  +  2 | User2                  +
  +  5 | User3                  +
  +  9 | User4                  +
  + 11 | User5                  +
  + 18 | User6                  +
  + .....                       +
  + 25 | User10                 +
  +-----------------------------+
  </code></pre>
  
  <p>and count the position oh each item, not the id, but the position where item is at this moment, all this with pagination, for e.g.:</p>
  
  <pre><code>Page 1
  1, User1, id1
  2, User2, id2
  3, User3, id5
  
  Page 2
  4, User4, id9
  5, User5, id11
  6, User6, id18
  
  Page 3
  ...
  </code></pre>
  
  <p>I understand that he must calculate the position of each item in the page list on every change of the page but don't know how to do this in MySQL. </p>
  
  <p>I will highly appreciate if someone will help me with an advice. Thanks</p>