diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index e104e119..b2b35d1d 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -3,14 +3,16 @@ * @param Min_Result * @param Min_DB connection to examine indexes * @param string base link for
+ $return = array(); // table => orgtable - mapping to use in EXPLAIN
odd(''); // reset odd for each result
for ($i=0; $row = $result->fetch_row(); $i++) {
if (!$i) {
@@ -21,6 +23,7 @@ function select($result, $connection2 = null, $href = "") {
$name = $field->name;
$orgtable = $field->orgtable;
$orgname = $field->orgname;
+ $return[$field->table] = $orgtable;
if ($href) { // MySQL EXPLAIN
$links[$j] = ($name == "table" ? "table=" : ($name == "possible_keys" ? "indexes=" : null));
} elseif ($orgtable != "") {
@@ -66,7 +69,8 @@ function select($result, $connection2 = null, $href = "") {
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
if ($href) { // MySQL EXPLAIN
- $link = $links[$key] . urlencode($row[array_search("table=", $links)]);
+ $table = $row[array_search("table=", $links)];
+ $link = $links[$key] . urlencode($orgtables[$table] != "" ? $orgtables[$table] : $table);
} else {
$link = "edit=" . urlencode($links[$key]);
foreach ($indexes[$links[$key]] as $col => $j) {
@@ -79,6 +83,7 @@ function select($result, $connection2 = null, $href = "") {
}
}
echo ($i ? "" : "