I am creating a "module" of my system and now I have to create a function that, when it arrives at the time that is in the database, execute a insert
. For example, if the table is the 22:00
time, at 10:00 pm every day it will run insert
.
The problem is that sometimes a delay or something like this can happen and the current time is 22h01
, and since it is in the 22h00
database, it will not execute the insert.
I was thinking about putting a break. If, for example, the bank is 22:00
it puts the interval of 1 hour, then if it is 10:00 PM until 11:00 PM it executes the insert. I have no idea how to do it, can anyone help me with this PHP code?
NOTE: I will also put a CRON to help.