1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 16:44:17 +02:00

MySQLi: Print error for editing invalid row

This commit is contained in:
Jakub Vrana
2014-01-13 21:24:55 -08:00
parent 24eb008794
commit e9b5616657

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