db_is_active

Definition

db_is_active()
includes/database/database.inc, line 1721

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

<?php
function db_is_active() {
  return Database::isActiveConnection();
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.