fixed a bug with null set as default

This commit is contained in:
Loïc Chapeaux
2001-08-29 20:49:25 +00:00
parent b186365534
commit 4bc2332148
2 changed files with 4 additions and 3 deletions

View File

@@ -40,7 +40,9 @@ if (isset($submit)) {
$query .= ' ' . $field_attribute[$i];
}
if ($field_default[$i] != '') {
if (get_magic_quotes_gpc()) {
if (strtoupper($field_default[$i]) == 'NULL') {
$query .= ' DEFAULT NULL';
} else if (get_magic_quotes_gpc()) {
$query .= ' DEFAULT \'' . sql_addslashes(stripslashes($field_default[$i])) . '\'';
} else {
$query .= ' DEFAULT \'' . sql_addslashes($field_default[$i]) . '\'';