I think your concept should change.
PHP cannot schedule a task, and MySQL cannot. Triggers in MySQL are executed when a mysql query occurs, and not at a specific time. Neither
This limitation is usually not a problem in web development. The reason is because your PHP application must control all the data coming in and out. This usually means only HTML that displays this data or other formats for users or other programs.
In your case, you can think of it this way. The deadline is the set date. You can treat it as data and save it in your database. When the deadline does not matter, it is that the data that you sent in your database is viewed correctly.
When a request arrives in your application, check if the last date was in the past, if so, then show that the project is closed - or update that the project is closed before displaying.
In fact, there is no reason to update the data of your PHP application yourself.
Typically, the only things you want to schedule are tasks that will affect your application in terms of load, or only need to do this once, or where concurrency or time is a problem.
In your case, none of them apply.
PS: I have not tried PHPscheduler, but I can guess that this is not a real scheduler. Cron is a deamon that sleeps until a given task appears in the queue, performs a task, and then sleeps until the next one (at least what it does in the current algorithm). PHP cannot do this without sockets and fork extensions, as a special setting. Thus, the PHPscheduler most likely just checks to see if the deadline for the task has expired every time the webpage loads (whenever PHP executes the page). This is no different than just checking if a project has expired without PHPScheduler overhead.
bucabay
source share