block table rename if newname empty

This commit is contained in:
Steve Alberty
2001-07-17 09:59:25 +00:00
parent 1fee1b72dc
commit eece3b3462
3 changed files with 37 additions and 24 deletions

View File

@@ -3,16 +3,25 @@
require("./grab_globals.inc.php3");
$old_name = $table;
$table = $new_name;
require("./header.inc.php3");
if (isset($new_name)) $new_name=trim($new_name); // Cleanup to suppress '' tables
if (isset($new_name) && $new_name!=""){
$old_name = $table;
$table = $new_name;
include("./header.inc.php3");
mysql_select_db($db);
$result = mysql_query("ALTER TABLE $old_name RENAME $new_name") or mysql_die();
$table = $old_name;
eval("\$message = \"$strRenameTableOK\";");
$table = $new_name;
}
else{
include("./header.inc.php3");
mysql_die($strTableEmpty);
}
mysql_select_db($db);
$result = mysql_query("ALTER TABLE $old_name RENAME $new_name") or mysql_die();
$table = $old_name;
eval("\$message = \"$strRenameTableOK\";");
$table = $new_name;
require("./tbl_properties.php3");
?>