日期:2014-05-16  浏览次数:20362 次

MySQL删除一个数据库下所有表
<?php
$hostname ='localhost';
$userid = 'root';
$password = '';
$dbname = 'database';
$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]");
}
?>