diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php index 6a173686d..d9a2ef2a7 100644 --- a/include/dblayer/functions_mysql.inc.php +++ b/include/dblayer/functions_mysql.inc.php @@ -503,7 +503,7 @@ INSERT INTO '.$table_name.' $is_first = false; } - if ($value === '') + if ($value === '' || is_null($value)) { $query .= 'NULL'; } diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php index 21adbeabe..4b28678a0 100644 --- a/include/dblayer/functions_mysqli.inc.php +++ b/include/dblayer/functions_mysqli.inc.php @@ -594,7 +594,7 @@ INSERT INTO '.$table_name.' $is_first = false; } - if ($value === '') + if ($value === '' || is_null($value)) { $query .= 'NULL'; }