<?php$lastime = strtotime($inputtime) - 60*60*24*rand(10,30);$lastime+=rand(1,100);echo date('Y-m-d h:i:s',$lastime);?>
<?php$mydbhost = "localhost"; //配置主机$mydbuser = ""; //数据库用户$mydbpw = ""; //数据库密码$mydbname = ""; //数据库名字$mydbcharset = "utf8"; //设置编码$link = mysql_connect($mydbhost,$mydbuser,$mydbpw) or die (mysql_error());mysql_select_db($mydbname,$link) or die("没有该数据库:".$mydbname);mysql_query("SET NAMES '$mydbcharset'");$catid = '228,229,230,231,232,233,234,235';$row= mysql_query("SELECT `id`,`inputtime` FROM `v9_news` WHERE `v9_news`.`catid` in($catid) ORDER BY `v9_news`.`id` DESC");while ($rs=mysql_fetch_array($row)){$id = $rs[id];$inputtime = $rs[inputtime];$lastime = $inputtime - 60*60*24*rand(80,150);$lastime+=rand(1,100);$sql = "UPDATE `v9_news` SET `inputtime` = '$lastime' WHERE `id`='$id'";mysql_query($sql);//echo $sql;}mysql_close();//关闭数据库连接?>
相关热词搜索:PHPCMS技巧批量更改文章发布时间PHPCMS文章采集
下一篇:内容页调用上级栏目名称的方法