mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 11:04:02 +02:00
Display NULL for all fields
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@259 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -32,7 +32,7 @@ function input($name, $field, $value) {
|
|||||||
} else {
|
} else {
|
||||||
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . (strlen($field["length"]) ? " maxlength='$field[length]'" : ($types[$field["type"]] ? " maxlength='" . $types[$field["type"]] . "'" : '')) . ' />';
|
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . (strlen($field["length"]) ? " maxlength='$field[length]'" : ($types[$field["type"]] ? " maxlength='" . $types[$field["type"]] . "'" : '')) . ' />';
|
||||||
}
|
}
|
||||||
if ($field["null"] && preg_match('~char|text|set|binary|blob~', $field["type"])) {
|
if ($field["null"] && $field["type"] != "enum") {
|
||||||
$id = "null-$name";
|
$id = "null-$name";
|
||||||
echo '<label for="' . $id . '"><input type="checkbox" name="null[' . $name . ']" value="1" id="' . $id . '"' . (isset($value) ? '' : ' checked="checked"') . ' />' . lang('NULL') . '</label>';
|
echo '<label for="' . $id . '"><input type="checkbox" name="null[' . $name . ']" value="1" id="' . $id . '"' . (isset($value) ? '' : ' checked="checked"') . ' />' . lang('NULL') . '</label>';
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ function process_input($name, $field) {
|
|||||||
global $mysql;
|
global $mysql;
|
||||||
$name = bracket_escape($name);
|
$name = bracket_escape($name);
|
||||||
$value = $_POST["fields"][$name];
|
$value = $_POST["fields"][$name];
|
||||||
if (preg_match('~char|text|set|binary|blob~', $field["type"]) ? $_POST["null"][$name] : !strlen($value)) {
|
if ($field["type"] != "enum" ? $_POST["null"][$name] : !strlen($value)) {
|
||||||
return "NULL";
|
return "NULL";
|
||||||
} elseif ($field["type"] == "enum") {
|
} elseif ($field["type"] == "enum") {
|
||||||
return (isset($_GET["default"]) ? "'" . $mysql->escape_string($value) . "'" : intval($value));
|
return (isset($_GET["default"]) ? "'" . $mysql->escape_string($value) . "'" : intval($value));
|
||||||
|
Reference in New Issue
Block a user