diff --git a/Library/Think/Db/Driver.php b/Library/Think/Db/Driver.php index 59ec35b8..2cf31e5c 100644 --- a/Library/Think/Db/Driver.php +++ b/Library/Think/Db/Driver.php @@ -144,13 +144,12 @@ abstract class Driver { E($this->error()); foreach ($bind as $key => $val) { if(is_array($val)){ - $this->PDOStatement->bindParam($key, $val[0], $val[1]); + $this->PDOStatement->bindValue($key, $val[0], $val[1]); }else{ - $this->PDOStatement->bindParam($key, $val); + $this->PDOStatement->bindValue($key, $val); } } - $result = $this->PDOStatement->execute(); - //$result = $this->PDOStatement->execute($bind); + $result = $this->PDOStatement->execute(); // 调试结束 $this->debug(false); if ( false === $result ) { @@ -186,9 +185,9 @@ abstract class Driver { } foreach ($bind as $key => $val) { if(is_array($val)){ - $this->PDOStatement->bindParam($key, $val[0], $val[1]); + $this->PDOStatement->bindValue($key, $val[0], $val[1]); }else{ - $this->PDOStatement->bindParam($key, $val); + $this->PDOStatement->bindValue($key, $val); } } $result = $this->PDOStatement->execute(); diff --git a/Library/Think/Db/Driver/Sqlsrv.php b/Library/Think/Db/Driver/Sqlsrv.php index f567d9ea..80e73fa8 100644 --- a/Library/Think/Db/Driver/Sqlsrv.php +++ b/Library/Think/Db/Driver/Sqlsrv.php @@ -160,4 +160,4 @@ class Sqlsrv extends Driver{ return $this->execute($sql,$this->parseBind(!empty($options['bind'])?$options['bind']:[])); } -} +} \ No newline at end of file