diff options
author | Robin Appelman <icewind1991@gmail.com> | 2010-07-05 15:35:41 +0400 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2010-07-05 15:35:41 +0400 |
commit | db5ac0b477b4e6e4a47a0bd0cc6321b3dd95957b (patch) | |
tree | b3887e23e7fdd5e1d239c458bd8efa4959a7e138 /inc/lib_base.php | |
parent | a73fbc5e32546bc693fbc45486c8c96d8f6757be (diff) | |
parent | 4e12ce63f974ee4ee3b67740fa931967a7fdca0f (diff) |
merge
Diffstat (limited to 'inc/lib_base.php')
-rwxr-xr-x | inc/lib_base.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php index d946f565c8a..67dbcb2eac9 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -302,6 +302,8 @@ class OC_UTIL { class OC_DB { static private $DBConnection=false; static private $schema=false; + static private $affected=0; + static private $result=false; /** * connect to the datbase if not already connected */ @@ -371,12 +373,15 @@ class OC_DB { }elseif($CONFIG_DBTYPE=='pgsql'){ $cmd=str_replace('`','"',$cmd); } - $result=self::$DBConnection->query($cmd); + $result=self::$DBConnection->exec($cmd); if (PEAR::isError($result)) { $entry='DB Error: "'.$result->getMessage().'"<br />'; $entry.='Offending command was: '.$cmd.'<br />'; die($entry); + }else{ + self::$affected=$result; } + self::$result=$result; return $result; } @@ -454,7 +459,7 @@ class OC_DB { * @return int */ static function affected_rows() { - self::$DBConnection->affectedRows(); + return self::$affected; } /** @@ -487,8 +492,11 @@ class OC_DB { * @param unknown_type $result * @return bool */ - static function free_result($result) { - $result->free(); + static function free_result() { + if(self::$result){ + self::$result->free(); + self::$result=false; + } } static public function disconnect(){ |