Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
catfan committed Jun 2, 2017
2 parents 00b2804 + 11680a3 commit bcabbef
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -464,6 +464,15 @@ protected function dataImplode($data, &$map, $conjunctor)
preg_match('/(#?)([a-zA-Z0-9_\.]+)(\[(?<operator>\>|\>\=|\<|\<\=|\!|\<\>|\>\<|\!?~)\])?/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' ];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1458,7 +1463,7 @@ public function debug()

public function error()
{
return $this->statement->errorInfo();
return $this->statement ? $this->statement->errorInfo() : null;
}

public function last()
Expand Down

0 comments on commit bcabbef

Please sign in to comment.