From e35a560759e53d48e918ee74bd9be86f52ea6e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Thu, 17 Nov 2016 14:20:50 +0100 Subject: [PATCH] fix single_insert when a field is null (#477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #449 Signed-off-by: Marc Poulhiès --- include/dblayer/functions_mysql.inc.php | 2 +- include/dblayer/functions_mysqli.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'; }