]> git.joonet.de Git - adminer.git/commitdiff
MySQLi: Print error for editing invalid row
authorJakub Vrana <jakub@vrana.cz>
Tue, 14 Jan 2014 05:24:55 +0000 (21:24 -0800)
committerJakub Vrana <jakub@vrana.cz>
Tue, 14 Jan 2014 05:24:55 +0000 (21:24 -0800)
adminer/edit.inc.php

index 50a75e34513242028567dfea22e5ba80146605ff..4e7be3cd086cdce482d2ea51088a63e295e296a1 100644 (file)
@@ -91,6 +91,9 @@ if ($_POST["save"]) {
        if ($select) {
                $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1), 0);
                $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;
                }