1.20.x 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

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

Code

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