php 删除数据库中的所有表



$hostname ='localhost';

$userid = 'root';
$password = 'root';
$dbname = 'gymnasium';
$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]");
}

你可能感兴趣的:(php程序优化)