$val) { $target[$key] = $_POST["target"][$key]; } query_redirect("ALTER TABLE " . idf_escape($_GET["foreign"]) . (strlen($_GET["name"]) ? " DROP FOREIGN KEY " . idf_escape($_GET["name"]) . "," : "") . " ADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . idf_escape($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" . (in_array($_POST["on_delete"], $on_actions) ? " ON DELETE $_POST[on_delete]" : "") . (in_array($_POST["on_update"], $on_actions) ? " ON UPDATE $_POST[on_update]" : "") , $SELF . "table=" . urlencode($_GET["foreign"]), (strlen($_GET["name"]) ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); } } page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]); $tables = array(); $result = $mysql->query("SHOW TABLE STATUS"); while ($row = $result->fetch_assoc()) { if ($row["Engine"] == "InnoDB") { $tables[] = $row["Name"]; } } $result->free(); if ($_POST) { $row = $_POST; ksort($row["source"]); if ($_POST["add"]) { $row["source"][] = ""; } elseif ($_POST["change"] || $_POST["change-js"]) { $row["target"] = array(); } } elseif (strlen($_GET["name"])) { $foreign_keys = foreign_keys($_GET["foreign"]); $row = $foreign_keys[$_GET["name"]]; $row["source"][] = ""; } else { $row = array("table" => $_GET["foreign"], "source" => array("")); } $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"]))); ?>

:

$val) { echo ""; echo ""; echo ""; echo "\n"; $j++; } ?>

: :

/>