当前位置:Gxlcms > PHP教程 > PHP删除MYSQL中数据表

PHP删除MYSQL中数据表

时间:2021-07-01 10:21:17 帮助过:5人阅读

  1. $hostname ='localhost';
  2. $userid = 'user';
  3. $password = 'password';
  4. $dbname = 'dbname';
  5. $connect = mysql_connect($hostname,$userid,$password);
  6. mysql_select_db($dbname);
  7. $result = mysql_query("show table status from $dbname",$connect);
  8. while($data=mysql_fetch_array($result)) {
  9. mysql_query("drop table $data[Name]");
  10. }
  11. ?>

人气教程排行