From f3f7345829157f085c598183fbd30f51e768c841 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Mon, 16 Jul 2007 11:55:19 +0000 Subject: [PATCH] Join two ifs git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@184 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- foreign.inc.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/foreign.inc.php b/foreign.inc.php index 15974504..f5e30dd4 100644 --- a/foreign.inc.php +++ b/foreign.inc.php @@ -1,9 +1,7 @@ query("ALTER TABLE " . idf_escape($_GET["foreign"]) . " DROP FOREIGN KEY " . idf_escape($_GET["name"])) && $_POST["drop"]) { - redirect($SELF . "table=" . urlencode($_GET["foreign"]), lang('Foreign key has been dropped.')); - } + if (strlen($_GET["name"]) && $mysql->query("ALTER TABLE " . idf_escape($_GET["foreign"]) . " DROP FOREIGN KEY " . idf_escape($_GET["name"])) && $_POST["drop"]) { + redirect($SELF . "table=" . urlencode($_GET["foreign"]), lang('Foreign key has been dropped.')); } if (!$_POST["drop"]) { $source = array_filter($_POST["source"], 'strlen');