PHP删除MySQL数据库下的所有数据表

<?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]"); 
}

?>
  

 

posted @ 2016-10-28 18:12  浮尘微光  阅读(713)  评论(0编辑  收藏  举报