Permalink
Browse files

Primary key detection for other drivers

  • Loading branch information...
1 parent c505440 commit 2ad8ab47707af1e6e4215d1f4b9e27fde222393b @vrana committed Jul 22, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 adminer/select.inc.php
View
@@ -28,7 +28,13 @@
if ($_POST && !$error) {
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
- $primary = ($indexes["PRIMARY"] ? ($select ? array_flip($indexes["PRIMARY"]["columns"]) : array()) : null); // empty array means that all primary fields are selected
+ $primary = null;
+ foreach ($indexes as $index) {
+ if ($index["type"] == "PRIMARY") {
+ $primary = ($select ? array_flip($index["columns"]) : array()); // empty array means that all primary fields are selected
+ break;
+ }
+ }
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
if (!$val["fun"]) {

0 comments on commit 2ad8ab4

Please sign in to comment.