diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 7fac3a1723..ba99324ba2 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -91,11 +91,20 @@ class db { return $this->Link_ID; } - // This only affects systems not using persistant connections - function disconnect() - { - return @mysql_close($this->Link_ID); - } + // This only affects systems not using persistant connections + function disconnect() + { + if($this->Link_ID <> 0) + { + @mysql_close($this->Link_ID); + $this->Link_ID = 0; + return 1; + } + else + { + return 0; + } + } function limit($start) {