Php deletes tables with the same prefix in the MySql database in batches. Php Tutorial batch delete MySql database tables with the same prefix in tutorial formidform1nameform1methodpostaction? Phpecho $ PHP_SELF ;?? Actionkilltablewidth425border0aligncente php Tutorial batch delete tables with the same prefix in the MySql database tutorial
If (@ $ _ GET ["action"] = "kill "){
If (empty ($ _ POST ['IP'])
Echo "you have not entered an IP address ";
Echo"
";
If (empty ($ _ POST ['user'])
Echo "you have not entered the user name ";
Echo"
";
If (empty ($ _ POST ['pass'])
Echo "you have not entered the password ";
Echo"
";
If (empty ($ _ POST ['DB'])
Echo "you have not entered the database ";
Echo"
";
If (empty ($ _ POST ['qz'])
Echo "you have not entered 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] deleted successfully!
";
}
}
}
}
?>
Batch delete tables with the same prefix in the MySql database tutorial form id = form1 name = form1 method = post action =? Php echo $ PHP_SELF ;?? Action = kill table width = 425 border = 0 align = cente...