From a194b2aabec276d6afaa251d64ffe54bfeae3b33 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sat, 14 Jul 2007 07:14:06 +0000 Subject: [PATCH] List only InnoDB tables git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@168 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- foreign.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/foreign.inc.php b/foreign.inc.php index 77a0d633..7c1aeec3 100644 --- a/foreign.inc.php +++ b/foreign.inc.php @@ -13,6 +13,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- } if ($mysql->query(" ALTER TABLE " . idf_escape($_GET["foreign"]) . " ADD FOREIGN KEY + " . (strlen($_GET["name"]) ? idf_escape($_GET["name"]) : "") . " (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . idf_escape($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ") @@ -26,6 +27,17 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- page_header(lang('Foreign key') . ": " . htmlspecialchars($_GET["foreign"])); +$tables = array(); +$result = $mysql->query("SHOW TABLE STATUS"); +while ($row = $result->fetch_assoc()) { + if ($row["Engine"] == "InnoDB") { + $tables[] = $row["Name"]; + } +} +$result->free(); +$source = get_vals("SHOW COLUMNS FROM " . idf_escape($_GET["foreign"])); //! no text and blob +$target = ($_GET["foreign"] === $row["table"] ? $source : get_vals("SHOW COLUMNS FROM " . idf_escape($row["table"]))); + if ($_POST) { $row = $_POST; ksort($row["source"]); @@ -46,15 +58,13 @@ if ($_POST) {

: - +

$val) { echo ""; echo "";