Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Link more foreign keys

  • Loading branch information...
commit 81f58ed9095dbb1a1ae79e433331ce210f2d3fda 1 parent c64557a
@vrana authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 adminer/select.inc.php
View
7 adminer/select.inc.php
@@ -300,12 +300,15 @@
if (!$link) { // link related items
foreach ((array) $foreign_keys[$key] as $foreign_key) {
- if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
+ if (count($foreign_keys[$key]) == 1 || end($foreign_key["source"]) == $key) {
+ $link = "";
foreach ($foreign_key["source"] as $i => $source) {
$link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
}
$link = h(($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link); // InnoDB supports non-UNIQUE keys
- break;
+ if (count($foreign_key["source"]) == 1) {
+ break;
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.