Skip to content
Snippets Groups Projects
Commit db5ac0b4 authored by Robin Appelman's avatar Robin Appelman
Browse files

merge

parents a73fbc5e 4e12ce63
No related branches found
No related tags found
No related merge requests found
...@@ -302,6 +302,8 @@ class OC_UTIL { ...@@ -302,6 +302,8 @@ class OC_UTIL {
class OC_DB { class OC_DB {
static private $DBConnection=false; static private $DBConnection=false;
static private $schema=false; static private $schema=false;
static private $affected=0;
static private $result=false;
/** /**
* connect to the datbase if not already connected * connect to the datbase if not already connected
*/ */
...@@ -371,12 +373,15 @@ class OC_DB { ...@@ -371,12 +373,15 @@ class OC_DB {
}elseif($CONFIG_DBTYPE=='pgsql'){ }elseif($CONFIG_DBTYPE=='pgsql'){
$cmd=str_replace('`','"',$cmd); $cmd=str_replace('`','"',$cmd);
} }
$result=self::$DBConnection->query($cmd); $result=self::$DBConnection->exec($cmd);
if (PEAR::isError($result)) { if (PEAR::isError($result)) {
$entry='DB Error: "'.$result->getMessage().'"<br />'; $entry='DB Error: "'.$result->getMessage().'"<br />';
$entry.='Offending command was: '.$cmd.'<br />'; $entry.='Offending command was: '.$cmd.'<br />';
die($entry); die($entry);
}else{
self::$affected=$result;
} }
self::$result=$result;
return $result; return $result;
} }
...@@ -454,7 +459,7 @@ class OC_DB { ...@@ -454,7 +459,7 @@ class OC_DB {
* @return int * @return int
*/ */
static function affected_rows() { static function affected_rows() {
self::$DBConnection->affectedRows(); return self::$affected;
} }
/** /**
...@@ -487,8 +492,11 @@ class OC_DB { ...@@ -487,8 +492,11 @@ class OC_DB {
* @param unknown_type $result * @param unknown_type $result
* @return bool * @return bool
*/ */
static function free_result($result) { static function free_result() {
$result->free(); if(self::$result){
self::$result->free();
self::$result=false;
}
} }
static public function disconnect(){ static public function disconnect(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment