PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 20, 2022

[FIXED] Run php script every day

 January 20, 2022     php, phpmyadmin, sql     No comments   

Issue

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


Solution

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



Answered By - Kareem Essawy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing