public function disconnect()
    {
        if (!$this->connected || !$this->server || ($this->mode ==  "mysql" && $this->server->connect_error)) {
            return false;
        }

        $result = false;

        switch ($this->mode) {

            case "mysql":
            case "sqlite":
                $result = $this->server->close();
                break;

            case "postgres":
            case "redshift":
                $result = pg_close($this->server);
                break;

            case "odbc":
                odbc_close($this->server);
                $result = true;
                break;

            case "mssql":
                $result = mssql_close($this->server);
                break;

            case "mssqlsrv":
                $result = sqlsrv_close($this->server);
                break;
        }

        # If the disconnect was successful, set class property to reflect it
        if ($result) {
            $this->connected = false;
        }

        return $result;
    }
public function disconnect()
    {
        if (!$this->connected || !$this->server || ($this->mode ==  "mysql" && $this->server->connect_error)) {
            return false;
        }

        $result = false;

        switch ($this->mode) {

            case "mysql":
            case "sqlite":
                $result = $this->server->close();
                break;

            case "postgres":
            case "redshift":
                $result = pg_close($this->server);
                break;

            case "odbc":
                odbc_close($this->server);
                $result = true;
                break;

            case "mssql":
                $result = mssql_close($this->server);
                break;

            case "mssqlsrv":
                $result = sqlsrv_close($this->server);
                break;
        }

        # If the disconnect was successful, set class property to reflect it
        if ($result) {
            $this->connected = false;
        }

        return $result;
    }
public function disconnect ( ) { if ( ! $ this -> connected || ! $ this -> server || ( $ this -> mode == "mysql" && $ this -> server -> connect_error ) ) { return false ; } $ result = false ; switch ( $ this -> mode ) { case "mysql" : case "sqlite" : $ result = $ this -> server -> close ( ) ; break ; case "postgres" : case "redshift" : $ result = pg_close ( $ this -> server ) ; break ; case "odbc" : odbc_close ( $ this -> server ) ; $ result = true ; break ; case "mssql" : $ result = mssql_close ( $ this -> server ) ; break ; case "mssqlsrv" : $ result = sqlsrv_close ( $ this -> server ) ; break ; } # If the disconnect was successful, set class property to reflect it if ( $ result ) { $ this -> connected = false ; } return $ result ; }
Close the sql connection
Close the sql connection