mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
Think/Db/Driver类 参数绑定方法bindParam改为bindValue
避免多个参数绑定时存在的引用问题
This commit is contained in:
@@ -144,13 +144,12 @@ abstract class Driver {
|
|||||||
E($this->error());
|
E($this->error());
|
||||||
foreach ($bind as $key => $val) {
|
foreach ($bind as $key => $val) {
|
||||||
if(is_array($val)){
|
if(is_array($val)){
|
||||||
$this->PDOStatement->bindParam($key, $val[0], $val[1]);
|
$this->PDOStatement->bindValue($key, $val[0], $val[1]);
|
||||||
}else{
|
}else{
|
||||||
$this->PDOStatement->bindParam($key, $val);
|
$this->PDOStatement->bindValue($key, $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$result = $this->PDOStatement->execute();
|
$result = $this->PDOStatement->execute();
|
||||||
//$result = $this->PDOStatement->execute($bind);
|
|
||||||
// 调试结束
|
// 调试结束
|
||||||
$this->debug(false);
|
$this->debug(false);
|
||||||
if ( false === $result ) {
|
if ( false === $result ) {
|
||||||
@@ -186,9 +185,9 @@ abstract class Driver {
|
|||||||
}
|
}
|
||||||
foreach ($bind as $key => $val) {
|
foreach ($bind as $key => $val) {
|
||||||
if(is_array($val)){
|
if(is_array($val)){
|
||||||
$this->PDOStatement->bindParam($key, $val[0], $val[1]);
|
$this->PDOStatement->bindValue($key, $val[0], $val[1]);
|
||||||
}else{
|
}else{
|
||||||
$this->PDOStatement->bindParam($key, $val);
|
$this->PDOStatement->bindValue($key, $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$result = $this->PDOStatement->execute();
|
$result = $this->PDOStatement->execute();
|
||||||
|
|||||||
Reference in New Issue
Block a user