
1:
使用php,插入数据时带一个time()的变量
2:
使用mysql自带的:将字弊此纯段设置成租咐扒让 timestamp 类型,输入默认值 CURRENT_TIMESTAMP ,这是一个mysql函数,这样就不自动将当前时间插入
windows:准备:
1.将 php.exe 的路径敬乎加入 windows 的环境变量
2.编陆稿喊写文件:
D:\fileGeter.php
<?php
$filelist = Array(
"http://**********/a.txt",
"http://**********/b.txt",
)
$saveas="D:\\"
$endl = ".txt"
function getfile(){
foreach( $filelist as $k =>$file )
file_put_contents( $saveas . $k . $endl , file_get_contents( $file ) )
}
getfile()
?>
3.执行cmd命令
at 11:20 /every:1,2,3,4,5,6,7 "php D:\fileGeter.php"
linux 更方便
直接把此文早野件包含进 你要写的程序里就OK了,
fileGeter.php:
<?php
...
...
$saveas = "./"
...
..
?>
index.php:
<?php
require_once("fileGeter.php")
//and so on .....
.....
....
....
?>
兄弟。。服务器是不能 *** 作数据库的,只有php才能 *** 作数据库。。应该是服务信枝陪器定期执行某个php程序,这个php程序刷新数据库。。linux下面可搭激以用crontab命令,把你的php程序写在一个文件里面滑蠢,然后用crontab命令定期调用。。欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)