How to connect mysql and do request on phaser game node socket

Hello need very help for my website.

I have ready game do in phaser node socket.

Socket work fine but i dont know how to connect the game to my mysql database and how to do request.

I want to mysql find user id, and when score is do, juste update score of the user on my mysql user table.

If anyone can help me i can have discuss on discord.

Hi

Javascript can’t doing a requests direct to the databases like mysql, but you can use an intermediary PHP like, and ajax in javascript to implement requestes through it’s.

Or you can using a server side javascript, like NODE.JS to implement this thing.

1 Like