1 database.inc db_set_active($key = 'default')

Sets a new active database.

Parameters

$key: The key in the $databases array to set as the default database.

Return value

The key of the formerly active database.:

Related topics

File

core/includes/database/database.inc, line 2672
Core systems for the database layer.

Code

function db_set_active($key = 'default') {
  return Database::setActiveConnection($key);
}