php - adding numbers to a database over time.

Associate
Joined
11 Oct 2008
Posts
268
Hi guys. I'm trying to think of a way to increase the number in a database over time. Its for a resourse section for a game im creating. Similar to lords and knights if anyone has played that on their phones.

At the moment the game refreshes every 30 seconds so I can easily code it to add +1 to the database on every refresh.

But I have no idea how I would make it so the +1 was added say every minute, even when the user was logged out.

I was wondering if someone could suggest some reading material or some function to look up that may help me with this.

I have tried google but not had much luck.

Thanks for any help
 
Associate
OP
Joined
11 Oct 2008
Posts
268
Thanks. I have done a quick google on cron jobs. So If Im understanding it correctly, I would have a simple bit of code to add+1 to the database, then I would set up a cron job in my hosting control panel to execute the code every minute. Is that correct ?
 
Back
Top Bottom