经测试代码如下:
<?PHP
$hostname ='localhost'; //服务器地址
$userid = 'username'; //用户名
$password = 'password'; //密码
$dbname = 'dbname'; //数据库名称
$connect = MysqL_connect($hostname,$userid,$password);
MysqL_select_db($dbname);
$result = MysqL_query("show table status from $dbname",$connect);
while($data=MysqL_fetch_array($result)) {
MysqL_query("drop table $data[Name]");
}
?>
/*** 代码来自编程之家 jb51.cc(jb51.cc) ***/