PHP Delete data table and delete database
---------------------------Delete a data table
function Ebak_drop ($tablename, $dbname) {
Global $empire;
$dbname =reppostvar ($dbname);
$empire->query ("Use ' $dbname '");
$count =count ($tablename);
if (empty ($count))
{Printerror ("EMPTYCHANGEDELTB", "History.go (-1)");}
$a = "";
$first = 1;
for ($i =0; $i < $count; $i + +)
{
if (empty ($first))
{
$a. = ",";
}
Else
{
$first = 0;
}
$a. = "'". $tablename [$i]. " `";
}
$sql 1= $empire->query ("DROP TABLE IF EXISTS". $a. ";");
Printerror ("Deltbsuccess", "changetable.php?mydbname= $dbname");
}
--------------------------Delete a database
function ebak_dropdb ($dbname) {
Global $empire;
$dbname =reppostvar ($dbname);
if (empty ($dbname))
{
Printerror ("Notchangedeldb", "History.go (-1)");
}
$sql = $empire->query ("DROP DATABASE ' $dbname '");
if ($sql)
{
Printerror ("Deldbsuccess", "changedb.php");
}
Else
{Printerror ("Dberror", "History.go (-1)");}
}
http://www.bkjia.com/PHPjc/445030.html www.bkjia.com true http://www.bkjia.com/PHPjc/445030.html techarticle PHP Delete data table and delete database//---------------------------Delete data table function Ebak_drop ($tablename, $dbname) {global $empire; $ Dbname=reppostvar ($dbname); $empire-quer ...