db_is_active

Definition

db_is_active()
drupal/includes/database/database.inc, line 1791

Description

Determine if there is an active connection.

Note that this method will return FALSE if no connection has been established yet, even if one could be.

Return value

TRUE if there is at least one database connection established, FALSE otherwise.

Related topics

Namesort iconDescription
Database abstraction layerAllow the use of different database servers using the same code base.

Code

function db_is_active() {
  return Database::isActiveConnection();
}