diff --git a/extensions/select_a_row.php b/extensions/select_a_row.php index 86e94f7..50c5788 100644 --- a/extensions/select_a_row.php +++ b/extensions/select_a_row.php @@ -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'); diff --git a/src/Webmodel.php b/src/Webmodel.php index 76c75e8..e117be5 100644 --- a/src/Webmodel.php +++ b/src/Webmodel.php @@ -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); + + } }