删除数据库所有表代码
删除数据库所有表代码Php代码1.<?php
2.$hostname ='localhost';//连接数据库地址
3.$userid = 'root';//连接账号
4.$password = ''; //连接密码
5.
6.$dbname = '3g3g';//数据库名称
7.$connect = mysql_connect($hostname,$userid,$password);
8.mysql_select_db($dbname);
9.$result = mysql_query("show table status from $dbname",$connect);
10.while($data=mysql_fetch_array($result)) {
11.mysql_query("drop table $data");
12.}
13.?>
页:
[1]