Write in the MySQL database when something happens?

I am creating a javascript game where you can walk around and pick up things, now it works great, but it does not save the things that you have collected in my database, so when you exit the game, you lose your progress,

I need to save in my database every time the user logs into something (when the div has a specific position). Right now there is a big javascript IF that basically removes the element from the map.

Is it possible for javascript to run the PHP code that is being written to the database? How can i do this?

+3
source share
3 answers

The way you do it is simple.

, - , script ajax- ( , ). , , , . , ajax, 5-10 . , DDoSing .

+1

Javascript , PHP ( ). , , PHP-, , AJAX.

+2

All Articles