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

PHP deletes data table in MYSQL

WBOY
Release: 2016-07-25 08:54:04
Original
1106 people have browsed it
  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. ?>
复制代码


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template