https://www.scirra.com/tutorials/346/on ... -php-mysql
This is a video tutorial that will walk you thru - step by step.
It does not use PDO prepared statements but it does work...
There are some things you could add to it like checking for the user IP address that would help prevent someone from submitting the same score twice.
Also, if you wanted, you could check the current top 10 high scores and if the current high score is lower than the lowest of the top 10, don't addict.... This would keep your list from growing...
It does use mysql tables so you would need your own server and the knowledge and capability of adding the database and tables, assigning rights and setting up the connection to the database...