Hello, how can I make the value field increase by 1 every 3 minutes in the database?

I have gas in the game. Now, if gasoline is less than 100, add +1 every 3 minutes until 100.

  • @ anonymous_911_ if it's not a secret, why do you need it? How to use sleep and request for an update - zenith
  • one
    Do you know what cron is? - lampa
  • No, what is it? - phpoma
  • four
    @ anonymous_911_, this is cron ;) - xEdelweiss
  • 3
    This can be solved simply using MySQL. Dig to the side of EVENT . - Indifferent

1 answer 1

Run the script every 3 minutes by cron and execute the query

 UPDATE car SET gas = gas + 1 WHERE gas < 100