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

merge

parents a73fbc5e 4e12ce63
Branches
No related tags found
No related merge requests found
......@@ -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(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment