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, "CHARACTER SET"); } if ($mysql->query( "CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . " $_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"); ?>