PHP Tutorial Bulk Delete a table with the same prefix in the MySQL database tutorial
if (@$_get["action"]== "Kill") {
if (Empty ($_post[' IP ')))
echo "You did not fill in the IP address";
echo "
";
if (Empty ($_post[' user '))
echo "You did not fill in the user name";
echo "
";
if (Empty ($_post[' pass ')))
echo "You did not fill in the password";
echo "
";
if (Empty ($_post[' db ')))
echo "You did not fill in the database";
echo "
";
if (Empty ($_post[' QZ ')))
echo "You did not fill in the prefix";
echo "
";
$ip =$_post[' IP '];
$user =$_post[' user '];
$pass =$_post[' pass ';
$db =$_post[' db '];
$qz =$_post[' QZ '];
$conn =mysql Tutorial _connect ($ip, $user, $pass);
if (! $conn) {
Die ("Database connection Error! Www.zhutiai.com ");
}
Mysql_connect ($ip, $user, $pass);
mysql_select_db ($DB);
$rs =mysql_query (' Show Tables ');
while ($arr =mysql_fetch_array ($rs)) {
$TF =strpos ($arr [0], $QZ);
if ($TF ===0) {
$FT =mysql_query ("drop table $arr [0]");
if ($FT) {
echo "$arr [0] Delete succeeded!
";
}
}
}
}
?>
http://www.bkjia.com/PHPjc/630750.html www.bkjia.com true http://www.bkjia.com/PHPjc/630750.html techarticle php Tutorial Bulk Delete MySQL database tutorial in the same prefix table Form Id=form1 name=form1 method=post action=?php echo $PHP _self;?? Action=kill table Widt h=425 border=0 align=cente ...