From 32cdbb430a6cac27890761e592a2a4d0f1feeda9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Aug 2014 02:59:50 +0000 Subject: [PATCH] * finish task #2042. --- lib/dao/dao.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index f63fad02a4..81193aeab2 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -438,11 +438,11 @@ class dao * @access public * @return object the PDOStatement object. */ - public function query() + public function query($sql = '') { if(!empty(dao::$errors)) return new PDOStatement(); // If any error, return an empty statement object to make sure the remain method to execute. - $sql = $this->processSQL(); + if(empty($sql)) $sql = $this->processSQL(); try { $method = $this->method; @@ -516,11 +516,11 @@ class dao * @access public * @return int the modified or deleted records. */ - public function exec() + public function exec($sql = '') { if(!empty(dao::$errors)) return new PDOStatement(); // If any error, return an empty statement object to make sure the remain method to execute. - $sql = $this->processSQL(); + if(empty($sql)) $sql = $this->processSQL(); try { $this->reset();