mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正bindParam方法
This commit is contained in:
@@ -510,11 +510,13 @@ abstract class Connection
|
|||||||
protected function bindParam($bind)
|
protected function bindParam($bind)
|
||||||
{
|
{
|
||||||
foreach ($bind as $key => $val) {
|
foreach ($bind as $key => $val) {
|
||||||
if (is_numeric($key)) {
|
$param = is_numeric($key) ? $key + 1 : ':' . $key;
|
||||||
$key = $key + 1;
|
if (is_array($val)) {
|
||||||
|
array_unshift($val, $param);
|
||||||
|
$result = call_user_func_array([$this->PDOStatement, 'bindParam'], $val);
|
||||||
|
} else {
|
||||||
|
$result = $this->PDOStatement->bindValue($param, $val);
|
||||||
}
|
}
|
||||||
array_unshift($val, $key);
|
|
||||||
$result = call_user_func_array([$this->PDOStatement, 'bindParam'], $val);
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$param = array_shift($val);
|
$param = array_shift($val);
|
||||||
throw new BindParamException(
|
throw new BindParamException(
|
||||||
|
|||||||
Reference in New Issue
Block a user