I'm currently making my own online PHP game, and I'm smack into the middle of the coding. The game is an industry/economy type game where you start out with some initial resources and a building and you expand your business empire by building more buildings that produce more buildings, which can be bought and sold on the live market. Basically, you try and become the wealthiest player in the game by the time the round ends.
My problem is, I need my game to update hourly and not hourly. Meaning, I have codes that update my MySQL database when a user buys or sells and makes transactions in my game. But, every hour, I would like my game to update the users resources with the output that their buildings are creating. If that's a little confusing, it's like a user has a Sawmill that uses 50 logs/hour and puts out 25 Lumber/hour.
I already have a table in my database that has the inputs and outputs/hour for the different buildings, but I need a way to update that into the users' resources. How would I go about doing that? Someone mentioned a cron job, but I'm not too sure.


