请问这段代码是做什么用的?在PDO.class.php文件里

请问这段代码是做什么用的?在PDO.class.php文件里

By 七味 at 2015-11-17
0人收藏 • 1134人看过

if (!empty($this->parameters)) {
    if (array_key_exists(0, $parameters)) {
        $parametersType = true;
        array_unshift($this->parameters, "");
        unset($this->parameters[0]);
    } else {
        $parametersType = false;
    }
    foreach ($this->parameters as $column => $value) {
        $this->sQuery->bindParam($parametersType ? intval($column) : ":" . $column, $this->parameters[$column]); //It would be query after loop end(before 'sQuery->execute()').It is wrong to use $value.
    }
}

3 个回复 | 最后更新于 2015-11-24
lincanbin
2015-11-17
#1

绑定PDO参数。

https://github.com/lincanbin/PHP-PDO-MySQL-Class

上面是文档,你只要知道怎么用就行了,不用管它的实现。

七味
2015-11-18
#2

好的,谢谢

铁大it小子
2015-11-24
#3

怎一个忧愁了得。


登 录


现在注册

QQ  登 录    Weibo  登 录    GitHub  登 录