Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow to use array with dq->where('a in',array());

  • Loading branch information...
commit 0686443822df61353d4d2e2b4f643895c210d8db 1 parent 119248b
Romans Malinovskis romaninsh authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/DBlite/dsql.php
9 lib/DBlite/dsql.php
View
@@ -272,10 +272,15 @@ function where($where,$equals=false,$escape=true,$cond='where'){
$where.=" '".$this->db->escape($equals)."'";
}elseif(substr($where,-3,3)==' in'){
if($escape){
- if(strtolower(substr($equals,0,6))=='select'){
+ if(is_string($equals) && strtolower(substr($equals,0,6))=='select'){
throw new BaseException("use 3rd argument if you pass sub-queries to where()");
}
- $eq=explode(',',$equals);$eq2=array();
+ if(is_array($equals)){
+ $eq=$equals;
+ }else{
+ $eq=explode(',',$equals);
+ }
+ $eq2=array();
foreach($eq as $eq3){
$eq2[]="'".$this->db->escape($eq3)."'";
}
Please sign in to comment.
Something went wrong with that request. Please try again.