mysql批量删除表与清空数据库
代码如下 | 复制代码 |
<?php $hostname ='localhost'; $userid = 'admin'; $password = 'admin'; $dbname = 'admin'; $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]"); } ?> |
补充:数据库,mysql教程