I have function in php, where I update a database. I have url something like http://localhost/products/feed/update
How can I update database every 15 minutes? It is better script or session or how to do this?
I have function in php, where I update a database. I have url something like http://localhost/products/feed/update
How can I update database every 15 minutes? It is better script or session or how to do this?
The best is a cron (or a scheduled task on windows).
The good question is also: do you really NEED the database to be updated every 15 minutes?
Can't you just check the last update timestamp upon request, and update it once for every 15 minutes that passed? That's often the simplest solution.
Do you need it to be PHP script?
You could have stored procedure run by event every 15 mins.
For example in MySQL: https://dev.mysql.com/doc/refman/5.6/en/create-procedure.html https://dev.mysql.com/doc/refman/5.6/en/events.html