diff --git a/dblayer.php b/dblayer.php index 9501355..daff43c 100644 --- a/dblayer.php +++ b/dblayer.php @@ -368,8 +368,11 @@ class dblayer extends PDO $display = array ($col1, $col2...); @param array|null $order Sort the columns by orientation $order = array (array ($key, $orientation), ...) - $key=>column, $orientation=ASC/DESC */ - public function read ($select=null, $display=null, $order=null) + $key=>column, $orientation=ASC/DESC + @param bool|null $whereOr The WHERE parameters are separated by OR instead + of AND*/ + public function read ($select=null, $display=null, $order=null, + $whereOr=false) { if ($this->db === null) throw new Exception (_("Database not connected"), 500); @@ -404,7 +407,12 @@ class dblayer extends PDO foreach ($select as $n=>$s) { if ($n > 0) - $req .= " AND"; + { + if ($whereOr === false) + $req .= " AND"; + else + $req .= " OR "; + } if (!isset ($s[2])) $s[2] = "="; $req .= " ".$s[0]." ".$s[2]." :".$s[0];