Alright, so im fairly new to MySQL and databases in general. And i want to make an update on the database after a set amount of time. Let me explain.
So for practise i'm building a game in php, and in this game you will be able to upgrade stuff. Say a building, upgrade it from level 1 to level 2 will take 2 hours. How can i make this event/scheluded on the database so that if the user loggs out it will still update even if he is offline? It's a multiplayer game so i kinda want the update to go through even if the player is offline.
I have tried to google and read up, but i cant realy get a clear understanding of how i would design and code it. I guess i will need an "events" table that will store all current upgrades that are qued and join each of them with a players unique ID? But then, how can i make it update on a set interval so all qued events take place when they are done?
If someone would be kind enought to give me an example or a walkthrough, i would greatly appreciate your time and effort. Thanks in advance!