Home > Backend Development > PHP Tutorial > PHP code to delete all tables in MYSQL database_PHP tutorial

PHP code to delete all tables in MYSQL database_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 14:57:39
Original
791 people have browsed it

If you don’t want to delete the library, but just want to delete all the tables in the library, then use this script.

It’s very convenient.

The following is the quoted content:
以下为引用的内容:
.$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]");
}
?>
. $hostname = 'localhost';

$userid = 'user';

$password = 'password';

$dbname = 'dbname'; 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]"); } ?>
http://www.bkjia.com/PHPjc/363978.htmlwww.bkjia.com
true
http: //www.bkjia.com/PHPjc/363978.htmlTechArticleIf you don’t want to delete the library, but just want to delete all the tables in the library, then use this script. It’s very convenient. . The following is the quoted content: .?php $hostname ='localhost'; $userid = 'user'; $passwo...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template