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

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

View File

@@ -129,6 +129,9 @@ abstract class Driver {
$this->initConnect(false); $this->initConnect(false);
if ( !$this->_linkID ) return 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(); if ( !empty($this->PDOStatement) ) $this->free();
$this->queryTimes++; $this->queryTimes++;
@@ -158,6 +161,9 @@ abstract class Driver {
$this->initConnect(true); $this->initConnect(true);
if ( !$this->_linkID ) return 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(); if ( !empty($this->PDOStatement) ) $this->free();
$this->executeTimes++; $this->executeTimes++;