]> git.joonet.de Git - adminer.git/commitdiff
Display error when getting row to edit
authorJakub Vrana <jakub@vrana.cz>
Wed, 24 Jan 2018 16:31:53 +0000 (17:31 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 24 Jan 2018 16:37:35 +0000 (17:37 +0100)
adminer/edit.inc.php
changes.txt

index c2ffc98c18d455a361b29548761a246355fc4f8d..a62831617abc732b0fd9cc69241756b67d2fb9c1 100644 (file)
@@ -82,9 +82,13 @@ if ($_POST["save"]) {
        }
        if ($select) {
                $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
-               $row = $result->fetch_assoc();
-               if (!$row) { // MySQLi returns null
-                       $row = false;
+               if (!$result) {
+                       $error = error();
+               } else {
+                       $row = $result->fetch_assoc();
+                       if (!$row) { // MySQLi returns null
+                               $row = false;
+                       }
                }
                if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers
                        $row = null;
index 117b38a585f29018cb8ea1405e48434302f5ad24..4de9e56e4bc9ce5ab8ede2357c3f96d2e8ad5427 100644 (file)
@@ -2,6 +2,7 @@ Adminer 4.5.0-dev:
 Display newlines in column comments (bug #573)
 Support current_timestamp() as default of time fields (bug #572)
 Hide window.opener from pages opened in a new window (bug #561)
+Display error when getting row to edit
 Store current Adminer version server-side to avoid excessive requests
 Adminer: Fix Search data in tables (regression from 4.4.0)
 CSP: Allow any styles, images, media and fonts, disallow base-uri