diff --git a/include/dba.php b/include/dba.php index ee62d309c..d9ab38f42 100644 --- a/include/dba.php +++ b/include/dba.php @@ -467,6 +467,22 @@ class dba { return $id; } + function __destruct() { + if ($this->db) { + switch ($this->driver) { + case 'pdo': + $this->db = null; + break; + case 'mysqli': + $this->db->close(); + break; + case 'mysql': + mysql_close($this->db); + break; + } + } + } + /** * @brief Replaces ANY_VALUE() function by MIN() function, * if the database server does not support ANY_VALUE(). @@ -487,22 +503,6 @@ class dba { return $sql; } - function __destruct() { - if ($this->db) { - switch ($this->driver) { - case 'pdo': - $this->db = null; - break; - case 'mysqli': - $this->db->close(); - break; - case 'mysql': - mysql_close($this->db); - break; - } - } - } - /** * @brief Executes a prepared statement *