Order collations

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@764 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-06-29 10:10:59 +00:00
parent c5b520cc46
commit d2fa62d284
2 changed files with 6 additions and 5 deletions

View file

@ -311,13 +311,13 @@ function collations() {
$return = array();
$result = $dbh->query("SHOW COLLATION");
while ($row = $result->fetch_assoc()) {
if ($row["Default"] && $return[$row["Charset"]]) {
array_unshift($return[$row["Charset"]], $row["Collation"]);
} else {
$return[$row["Charset"]][] = $row["Collation"];
}
$return[$row["Charset"]][] = $row["Collation"];
}
$result->free();
ksort($return);
foreach ($return as $key => $val) {
sort($return[$key]);
}
return $return;
}

View file

@ -25,6 +25,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
page_header((strlen($_GET["procedure"]) ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . htmlspecialchars($_GET["procedure"]) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error);
$collations = get_vals("SHOW CHARACTER SET");
sort($collations);
$row = array("fields" => array());
if ($_POST) {
$row = $_POST;