Home  >  Article  >  Backend Development  >  PHP deletes data table in MYSQL

PHP deletes data table in MYSQL

WBOY
WBOYOriginal
2016-07-25 08:54:041030browse
  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. ?>
复制代码


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn