I don't know PDO, but you want to count how many users have more points than the profile page's user, via the qa_userpoints table.
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.
May 7, 2020: Q2A 1.8.4 released!