From: Jakub Vrana Date: Sun, 17 Oct 2010 14:37:22 +0000 (+0200) Subject: Save NULL for empty string in inline-edit X-Git-Tag: v3.0.1~16 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=53d7f0306df88538933d49b9bf6d70c04318fab7;p=adminer.git Save NULL for empty string in inline-edit --- diff --git a/adminer/select.inc.php b/adminer/select.inc.php index c541d837..191701a6 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -126,7 +126,7 @@ if ($_POST && !$error) { $set = array(); foreach ($row as $key => $val) { $key = bracket_escape($key, 1); // 1 - back - $set[] = idf_escape($key) . " = " . $adminer->processInput($fields[$key], $val); + $set[] = idf_escape($key) . " = " . (ereg('varchar|text', $fields[$key]["type"]) || $val != "" ? $adminer->processInput($fields[$key], $val) : "NULL"); } $result = queries("UPDATE" . limit1(table($TABLE) . " SET " . implode(", ", $set), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key if (!$result) {