I was looking here, but can't find the answer to my question.
Need to get a list of objects from MySQL, for e.g.:
+-----------------------------+
+ id | username | password +
+-----------------------------+
+ 1 | User1 +
+ 2 | User2 +
+ 5 | User3 +
+ 9 | User4 +
+ 11 | User5 +
+ 18 | User6 +
+ ..... +
+ 25 | User10 +
+-----------------------------+
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.:
Page 1
1, User1, id1
2, User2, id2
3, User3, id5
Page 2
4, User4, id9
5, User5, id11
6, User6, id18
Page 3
...
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.
I will highly appreciate if someone will help me with an advice. Thanks