user8661606
user8661606

Reputation:

Run php script every day

Is there any way I could run a php script every day with phpmyadmin? I can't do it with the events because I need to send a mail to the user which I can't do with SQL.

Thank you

Upvotes: 0

Views: 1324

Answers (1)

Kareem Essawy
Kareem Essawy

Reputation: 615

you can write your query and/or script in a function then use the cronjob on the server to call this function every certain time so for example if you are using ssh do the following

$ crontab -e

this command will open the cronjob page to list all the cronjobs you have then enter the following line

0 1 * * *  path_to_your_function

then save and close

0 1 * * * it means everyday at 1 o'clock the server will call the function that has the queries or the php script you wrote

you can customize the cronjob timing and test it here

i would also like to recommend you to check the answer on Scheduling php script in phpMyAdmin 3.3.8.1

Upvotes: 6

Related Questions