diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index 29a792a2..6a12a785 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -89,8 +89,11 @@ if ($_POST["save"]) { $select = array("*"); } if ($select) { - $rows = get_rows("SELECT" . limit(implode(", ", $select) . " FROM " . table($TABLE), " WHERE $where", (isset($_GET["select"]) ? 2 : 1))); - $row = (isset($_GET["select"]) && count($rows) != 1 ? null : reset($rows)); + $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1), 0); + $row = $result->fetch_assoc(); + if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers + $row = null; + } } } diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 88d0998a..b6dcd325 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -169,10 +169,10 @@ username.form['auth[driver]'].onchange(); */ function selectQuery($query) { global $jush; - return "

" . h(str_replace("\n", " ", $query)) . "" + return ($_GET["edit"] != "" ? "" : "

" . h(str_replace("\n", " ", $query)) . "" . (support("sql") ? " " . lang('Edit') . "" : "") . "

" //

- required for IE9 inline edit - ; + ); } /** Description of a row in a table