mysql - Can you run database queries in a PHP cron job? -


I have tried to look around for an answer, and nothing to answer this specific question properly. guess not.

Is it possible to setup a cron job for a PHP file that has MySQL database queries? As I currently understand, it is possible to execute a PHP file via a cron, but whether I have read some disputed posts or not that the PHP file contains MySQL queries or not. I have a site function where I am planning to, from time to time, a whole bunch of data from a database run through some PHP and need to know to be reinforced in the database with modifications .

Cheers

You can run any PHP file using Cron . Simply use a syntax to add a PHP file to the cron:

  01 04 1 1 1 /var/www/somedirectory/somephpfile.php  

You can see more Option for CRON

Then somephpfile.php can have a CRUD operation, which is supported by PHP.

The less you can call the error-free in any PHP file and it will definitely run (if it runs when you try to run it directly in the browser) in


Comments

Popular posts from this blog

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

scala - Play Framework - how to bind form to a session field -