fixes in conditions

This commit is contained in:
Antonio de la Rosa 2016-09-05 06:29:29 +02:00
parent c30a4a5da1
commit c4a7f65833
2 changed files with 13 additions and 7 deletions

View file

@ -27,7 +27,7 @@ function select_a_row_method_class($class, $idrow, $arr_select=array(), $raw_que
settype($idrow, 'integer');
$class->set_conditions('where '.$class->name.'.`'.$class->idmodel.'`=\''.$idrow.'\'');
$class->set_conditions(['where '.$class->name.'.`'.$class->idmodel.'`=?', [$idrow]]);
$class->set_limit('limit 1');

View file

@ -713,10 +713,10 @@ class Webmodel {
$args=$this->args;
$raw_query=0;
if(gettype($conditions)=='array')
{
$str_conditions=$conditions[0];
$args=$conditions[1];
@ -738,9 +738,9 @@ class Webmodel {
$args=[];
}
$str_conditions=trim($str_conditions);
if($str_conditions=='')
{
@ -749,12 +749,12 @@ class Webmodel {
}
else
{
//Check execution
if($raw_query==0)
{
if(preg_match('/".*"/', $str_conditions) || preg_match('/\'.*\'/', $str_conditions))
{
@ -785,6 +785,12 @@ class Webmodel {
}
else
{
$this->conditions=trim($str_conditions);
}
}