gcdb::close()

最后更新于:2021-11-26 08:06:27

gcdb::close()

Closes the current database connection.

响应

(bool) True if the connection was successfully closed, false if it wasn’t, or if the connection doesn’t exist.

源文件

文件: gc-includes/gc-db.php

	public function close() {
		if ( ! $this->dbh ) {
			return false;
		}

		if ( $this->use_mysqli ) {
			$closed = mysqli_close( $this->dbh );
		} else {
			$closed = mysql_close( $this->dbh );
		}

		if ( $closed ) {
			$this->dbh           = null;
			$this->ready         = false;
			$this->has_connected = false;
		}

		return $closed;
	}