PHP删除MYSQL中数据表
时间:2021-07-01 10:21:17
帮助过:5人阅读
- $hostname ='localhost';
- $userid = 'user';
- $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]");
- }
- ?>
|