因为站点数据比较庞大,有部分违规词,这是很严重的,所以要批量输入关键词自动生成mysql删除语句,然后复制到mysql命令进行删除,这样比较方便。
代码如下,比如要生成21资讯模块下的内容违规词删除语句,只需要在21资讯模块目录下新建一个stopmysql.php
<?php require '../common.inc.php'; include './config.inc.php'; $mid=$moduleid; $module = $MODULE[$mid]['module']; $modurl = $MODULE[$mid]['linkurl']; $modulename=$MODULE[$mid]['name']; $table = get_table($mid); $condition = "status=3"; $keyword=$_GET['keyword']; $result = $db->query("SELECT itemid from {$table} where {$condition} ORDER BY itemid desc LIMIT 0,1"); $r = $db->fetch_array($result); $itemid=$r['itemid']; $zhengshu=100000; $chufa=$itemid/$zhengshu; $split=ceil($chufa); $count=$split+1; for($i=0;$i<$split;$i++) { $fen=$i+1; echo "DELETE from {$table} where itemid in (select itemid from {$CFG['tb_pre']}{$mid}_{$fen} where content like '%{$keyword}%');<br/>"; } ?>
然后在浏览器执行:
stopmysql.php?keyword=你要删除的关键词
标签:语句,itemid,删除,destoon8.0,生成,违规,模块 From: https://www.cnblogs.com/68xi/p/17401726.html