Display error when getting row to edit

This commit is contained in:
Jakub Vrana 2018-01-24 17:31:53 +01:00
parent 25f9655a38
commit 921e57b9aa
2 changed files with 8 additions and 3 deletions

View 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;

View 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