In general, there is a script in PHP & MySQL, you need to implement this function: A person visits the site and wants to replenish the balance on the site, I give him the purse number to replenish and 2 hours to replenish, but if he does not replenish within 2 hours how to make an application in The database assumed the status of inactive, and in general how to do some manipulations in the database after some time

  • perhaps cron will suit you - it gives you the opportunity to run the script at a specific time or after a specific period of time ... - Boris will run
  • And why do you need to do some manipulations in the database after a time? Write to the record immediately the time of the action. All entries for which no money was received and the expiration date less than the current machine are considered inactive. - Mike

1 answer 1

Create a new field create_time (type INT) in the ticket table and specify the time () value there when creating the ticket. When retrieving data, check the current time () with the saved value in the database. If (time () - create_time) / 3600> 2, then the application is not active.

Another option is to create a deadline_time field and record the time there 2 hours later than the current time. time () + 2 * 3600. Next, check the field with the current time ()