记录的sql日志 添加参数绑定信息

This commit is contained in:
ThinkPHP
2013-04-20 16:45:41 +08:00
parent ef82de8fa5
commit 5f6cf44f0c

View File

@@ -128,7 +128,10 @@ abstract class Driver {
public function query($str,$bind=[]) {
$this->initConnect(false);
if ( !$this->_linkID ) return false;
$this->queryStr = $str;
$this->queryStr = $str;
if(!empty($bind)){
$this->queryStr .= '[ '.print_r($bind,true).' ]';
}
//释放前次的查询结果
if ( !empty($this->PDOStatement) ) $this->free();
$this->queryTimes++;
@@ -158,6 +161,9 @@ abstract class Driver {
$this->initConnect(true);
if ( !$this->_linkID ) return false;
$this->queryStr = $str;
if(!empty($bind)){
$this->queryStr .= '[ '.print_r($bind,true).' ]';
}
//释放前次的查询结果
if ( !empty($this->PDOStatement) ) $this->free();
$this->executeTimes++;