PHP Bulk Delete the same prefixes in MySQL database table _php Tutorial

Source: Internet
Author: User
Tags mysql tutorial
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.