So I've been struggling lately with this issue. I have a leaderboard done in MySQL and I "get" and "post" all requests via AJAX and PHP. I get the top 10 (or any number), but I don't know how to get the players rank in the whole database.
If I get it right, I have to request the whole database and filter it to match the players ID. However, it's a mobile game and requesting the whole database seems like it could cause performance issues.
How can I do this? (I know how to get the rank inside MySQL, but I struggle with construct)