CODE: [Copy to clipboard]把上面的代码保存为*.php文件即可!<?php
$user = ""; //数据库用户名
$password = "";//数据库密码
$db_name = "";//数据库名
$link = mysql_connect("localhost:3306",$user,$password);
mysql_select_db("$db_name",$link);
echo "<p>正在清空数据库...";
$result=mysql_query("SHOW tables",$link);
while ($currow=mysql_fetch_array($result)) {
mysql_query("drop TABLE IF EXISTS $currow[0]");
echo $currow[0]."<br>";
}
echo "成功</p>";
?>
欢迎光临 骤雨打新荷 (http://txfzq.free.fr/bbs/) | Powered by Discuz! 2.5 |