diff --git a/dblayer.php b/dblayer.php index ed262aa..03fae1f 100644 --- a/dblayer.php +++ b/dblayer.php @@ -738,7 +738,11 @@ class dblayer // name is 'group' // Don't put single quotes : don't work with SQLite // TODO : Test for PostgreSQL (Tested for SQLite and MySQL) - $req .= " $this->sep".$s[0]."$this->sep ".$s[2]." :".md5 ($s[0].$s[1]); + if ($s[1] !== null) + $req .= " $this->sep".$s[0]."$this->sep ".$s[2]." :". + md5 ($s[0].$s[1]); + else + $req .= " $this->sep".$s[0]."$this->sep IS NULL"; } $req .=")"; } @@ -795,6 +799,8 @@ class dblayer { foreach ($select as $s) { + if ($s[1] === null) + continue; if ($this->debug) echo "DEBUG BIND : ".$s[0]."(".md5 ($s[0].$s[1]).")->". var_export ($s[1], TRUE)."\n"; $st->bindValue (":".md5 ($s[0].$s[1]), $s[1]);