diff --git a/src/Medoo.php b/src/Medoo.php index 8e5ee340..f91fc355 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -2,7 +2,7 @@ /*! * Medoo database framework * https://medoo.in - * Version 1.4.3 + * Version 1.4.4 * * Copyright 2017, Angel Lai * Released under the MIT license @@ -464,6 +464,15 @@ protected function dataImplode($data, &$map, $conjunctor) preg_match('/(#?)([a-zA-Z0-9_\.]+)(\[(?\>|\>\=|\<|\<\=|\!|\<\>|\>\<|\!?~)\])?/i', $key, $match); $column = $this->columnQuote($match[ 2 ]); + if (!empty($match[ 1 ])) + { + $wheres[] = $column . + (isset($match[ 'operator' ]) ? ' ' . $match[ 'operator' ] . ' ' : ' = ') . + $this->fnQuote($key, $value); + + continue; + } + if (isset($match[ 'operator' ])) { $operator = $match[ 'operator' ]; @@ -564,10 +573,6 @@ protected function dataImplode($data, &$map, $conjunctor) $condition .= $map_key; $map[ $map_key ] = [$value, PDO::PARAM_INT]; } - elseif (strpos($key, '#') === 0) - { - $condition .= $this->fnQuote($key, $value); - } else { $condition .= $map_key; @@ -1458,7 +1463,7 @@ public function debug() public function error() { - return $this->statement->errorInfo(); + return $this->statement ? $this->statement->errorInfo() : null; } public function last()