From 2c48bf162f2a8e7cf13e8c53b1205cc0f65132e5 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 6 Feb 2008 18:01:14 +0000 Subject: Fixed ticket#766, #786 - TDbCache does not work with MySQL and PostgreSQL --- framework/Data/TDbCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'framework/Data') diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php index caa4476b..90e86844 100644 --- a/framework/Data/TDbCommand.php +++ b/framework/Data/TDbCommand.php @@ -276,7 +276,10 @@ class TDbCommand extends TComponent $this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText()); $result=$this->_statement->fetchColumn(); $this->_statement->closeCursor(); - return $result; + if(is_resource($result) && get_resource_type($result)==='stream') + return stream_get_contents($result); + else + return $result; } catch(Exception $e) { -- cgit v1.2.3