参数自动绑定采用数字key 避免sqlsrv不支持的情况

This commit is contained in:
ThinkPHP
2013-04-27 13:24:11 +08:00
parent 5995908cbb
commit 6665cc8f88

View File

@@ -329,8 +329,8 @@ abstract class Driver {
if(0===strpos($val,':')){
$set[] = $this->parseKey($key).'='.$this->parseValue($val);
}else{
$name = md5($key);
$set[] = $this->parseKey($key).'=:T'.$name;
$name = count($this->bind);
$set[] = $this->parseKey($key).'=:'.$name;
$this->bindParam($name,$val);
}
}
@@ -346,7 +346,7 @@ abstract class Driver {
* @return void
*/
protected function bindParam($name,$value){
$this->bind[':T'.$name] = $value;
$this->bind[':'.$name] = $value;
}
/**
@@ -747,8 +747,8 @@ abstract class Driver {
if(0===strpos($val,':')){
$values[] = $this->parseValue($val);
}else{
$name = md5($key);
$values[] = ':T'.$name;
$name = count($this->bind);
$values[] = ':'.$name;
$this->bindParam($name,$val);
}
}