From d20bf39150020d314be1a5605a8fdcf4bf47a4cc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 11 Jul 2007 20:07:25 +0000 Subject: [PATCH] *Make null values of arrays use NULL(for lists) or IS NULL, rather than x = NULL, which doesn't work --- includes/Database.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/Database.php b/includes/Database.php index 160e14369e..4e6efa4cfe 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1531,8 +1531,13 @@ class Database { $list .= "($value)"; } elseif ( ($mode == LIST_SET) && is_numeric( $field ) ) { $list .= "$value"; - } elseif ( ($mode == LIST_AND || $mode == LIST_OR) && is_array ($value) ) { + } elseif ( ($mode == LIST_AND || $mode == LIST_OR) && is_array($value) ) { $list .= $field." IN (".$this->makeList($value).") "; + } elseif( is_null($value) ) { + if ( $mode == LIST_AND || $mode == LIST_OR || $mode == LIST_SET ) { + $list .= "$field IS "; + } + $list .= 'NULL'; } else { if ( $mode == LIST_AND || $mode == LIST_OR || $mode == LIST_SET ) { $list .= "$field = "; -- 2.20.1