1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Save '' instead of NULL for empty char (some drivers don't have varchar)

This commit is contained in:
Jakub Vrana
2010-10-17 22:37:06 +02:00
parent 9db4259409
commit 0782a7b2c1
2 changed files with 2 additions and 2 deletions

View File

@@ -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) . " = " . (ereg('varchar|text', $fields[$key]["type"]) || $val != "" ? $adminer->processInput($fields[$key], $val) : "NULL");
$set[] = idf_escape($key) . " = " . (ereg('char|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) {