1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Order by first index in Editor by default

Flush before SHOW DATABASES by default

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@923 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-28 11:04:49 +00:00
parent e1abcda063
commit a3d2266a9c
4 changed files with 17 additions and 15 deletions

View File

@@ -32,12 +32,7 @@ $group_by = ($group && count($group) < count($select) ? " GROUP BY " . implode("
if ($_POST && !$error) {
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
$primary = null; // empty array means that all primary fields are selected
foreach ($indexes as $index) {
if ($index["type"] == "PRIMARY") {
$primary = ($select ? array_flip($index["columns"]) : array());
}
}
$primary = ($indexes["PRIMARY"] ? ($select ? array_flip($indexes["PRIMARY"]["columns"]) : array()) : null); // empty array means that all primary fields are selected
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
if (!$val["fun"]) {
@@ -189,7 +184,7 @@ if (!$columns) {
if (strlen($name)) {
$order++;
$names[$key] = $name;
echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>";
echo '<th><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; //! order by function can collide with column name like min(`id`)
}
next($select);
}