This commit is contained in:
Mark van Driel 2017-02-12 21:30:41 +01:00
commit da15a8346b

16
api.php
View file

@ -1167,8 +1167,10 @@ class PHP_CRUD_API {
case 'le': return array('! <= ?',$field,$value);
case 'ge': return array('! >= ?',$field,$value);
case 'gt': return array('! > ?',$field,$value);
case 'bt': $v = explode(',',$value); if (count($v)<2) return false;
return array('! BETWEEN ? AND ?',$field,$v[0],$v[1]);
case 'bt':
$v = explode(',',$value);
if (count($v)<2) return false;
return array('! BETWEEN ? AND ?',$field,$v[0],$v[1]);
case 'in': return array('! IN ?',$field,explode(',',$value));
case 'is': return array('! IS NULL',$field);
}
@ -1204,8 +1206,10 @@ class PHP_CRUD_API {
case 'nle': return array('! > ?',$field,$value);
case 'nge': return array('! < ?',$field,$value);
case 'ngt': return array('! <= ?',$field,$value);
case 'nbt': $v = explode(',',$value); if (count($v)<2) return false;
return array('! NOT BETWEEN ? AND ?',$field,$v[0],$v[1]);
case 'nbt':
$v = explode(',',$value);
if (count($v)<2) return false;
return array('! NOT BETWEEN ? AND ?',$field,$v[0],$v[1]);
case 'nin': return array('! NOT IN ?',$field,explode(',',$value));
case 'nis': return array('! IS NOT NULL',$field);
}
@ -1518,7 +1522,7 @@ class PHP_CRUD_API {
foreach ($keys as $key=>$other) {
$columns.=",$table.$key,".implode('.',$other);
}
}
}
}
return $columns;
}
@ -1923,7 +1927,7 @@ class PHP_CRUD_API {
// connect
$request = trim($request,'/');
if (!$database) {
$database = $this->parseRequestParameter($request, 'a-zA-Z0-9\-_');
$database = $this->parseRequestParameter($request, 'a-zA-Z0-9\-_');
}
if (!$db) {
$db = new $dbengine();