This article is introduced by the tutorial column of Pagoda Panel on how to implement regular execution of PHP to operate the database in Pagoda shell. I hope it will be helpful to you if you need it!
Want to use Pagoda shell to clear database data regularly
1. Create these two files in any location
2. Customize the sql you want to execute in the jrsy.php file and operate the database
<?php $link = mysqli_connect("localhost","数据库用户名","数据库密码","数据库名称") or die("Error " . mysqli_error($link)); //连接,test为数据库的名称 $query = "UPDATE yh_business SET calltoday=0" or die("Error in the consult.." . mysqli_error($link));//查询 $result = mysqli_query($link, $query);//查询的结果 echo '清空今日调用' ?>
2. Write the shell in jrsy.sh to execute jrsy.php
#/ php /www/wwwroot/jx.kissxx.cn/public/jrsy.php
3. Specify the sh path to be executed in the shell script scheduled task
, and it will be ok.
The above is the detailed content of How to execute timing in Pagoda shell (detailed explanation of steps). For more information, please follow other related articles on the PHP Chinese website!