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

Empty value in Editor as NULL

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@886 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-23 16:22:50 +00:00
parent e13720e569
commit a78c941cd4
3 changed files with 47 additions and 13 deletions

View File

@@ -146,6 +146,25 @@ function adminer_edit_input($table, $field) {
return call_adminer('edit_input', $return, $table, $field);
}
/** Process sent input
* @param string field name
* @param array single field from fields()
* @return string expression to use in a query
*/
function adminer_process_input($name, $field) {
global $dbh;
$idf = bracket_escape($name);
$function = $_POST["function"][$idf];
$value = $_POST["fields"][$idf];
$return = $dbh->quote($value);
if (!ereg('varchar|text', $field["type"]) && !strlen($value)) {
$return = "NULL";
} elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
$return = $value;
}
return call_adminer('process_input', $return, $name, $field);
}
function adminer_navigation($missing) {
global $SELF;
if (call_adminer('navigation', true, $missing) && $missing != "auth") {