From 5f6cf44f0c497d0430b65a6e520be4faf2be774b Mon Sep 17 00:00:00 2001 From: ThinkPHP Date: Sat, 20 Apr 2013 16:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=9A=84sql=E6=97=A5?= =?UTF-8?q?=E5=BF=97=20=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Think/Db/Driver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Think/Db/Driver.php b/Library/Think/Db/Driver.php index 9466fa7f..77d36b43 100644 --- a/Library/Think/Db/Driver.php +++ b/Library/Think/Db/Driver.php @@ -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++;