From: jakubvrana Date: Mon, 16 Jul 2007 23:08:24 +0000 (+0000) Subject: Prepare procedures X-Git-Tag: v3.0.0~1310 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=67096cd08f5e23238cfe69a30a4a75d1551de17f;p=adminer.git Prepare procedures git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@198 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/procedure.inc.php b/procedure.inc.php new file mode 100644 index 00000000..7d39d781 --- /dev/null +++ b/procedure.inc.php @@ -0,0 +1,35 @@ +query("DROP $routine " . idf_escape($_GET["procedure"])) && $_POST["drop"]) { + redirect(substr($SELF, 0, -1), lang('Routine has been dropped.')); + } + if (!$_POST["drop"]) { + $set = array(); + ksort($_POST["fields"]); + foreach ($_POST["fields"] as $field) { + $set[] = idf_escape($field["field"]) . process_type($field); + } + if ($mysql->query( + "CREATE $routine " . idf_escape($_POST["name"]) + . " (" . implode(", ", $set) . ")" + . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"]) : "") . " + $_POST[definition]" + )) { + redirect(substr($SELF, 0, -1), (strlen($_GET["createp"]) ? lang('Routine has been altered.') : lang('Routine has been created.'))); + } + } +} + +$collations = get_vals("SHOW CHARACTER SETS"); +?> + + +
+ + + +