* finish task #2042.

This commit is contained in:
wangyidong
2014-08-15 02:59:50 +00:00
parent 7af17a2e4a
commit 32cdbb430a
+4 -4
View File
@@ -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();