you should have an encrypted packet that sends to the server then the server will validate it and add it to the table or else it doesn’t. Never put the mysql pass/user in the client because then they can access your SQL server, and you’ll have to also portforward 3306.
Best way IMO is to send a score gain packet everytime they gain a score then send an end of game packet to add it to the highscore.

