Jump to content

Field change overtime.


rok259

Recommended Posts

Hello

 

Is it possible to have my database increase an integer overtime? For instance every 1 minute add +1 to int field.

 

Only way I could think of getting the result would be to use a PHP script, but not sure if its possible.

 

 

Link to comment
Share on other sites

 

Why? Wouldn't it make more sense to write a before-trigger to fake this?

 

I’m developing an RTS MMO that will require resources to gather when the player is logged out of the game. Best way I could think of achieving this would be to have the database auto update the field.

 

Also thanks for the Cron idea, I will check it out.

Link to comment
Share on other sites

or you could just track the time which the user left, and then figure out how much time has passed at his next login, and then update the column that way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...