So what I'm building is like a game, with a point system. You create an account and you start with 0 points. Then you can play a snake game(made with JS) to collect points, every time you finish the snake game, depending on your score you get specific amount of points.
Now those "points" are saved in a MYSQL database along with your account information ex. username, password, etc. Now because the snake game is made with JS, how will I be able to update MYSQL database and add points to the "points" variable in the database. Basically how will the server(PHP) know that the JS snake game has finished and that x points should be added in the MYSQL database.