API page: http://api.drupal.org/api/drupal/includes--database.inc/function/db_set_...
Describe the problem you have found:
[my original message seems to have been lost by using "preview"... here it is below]
It's unclear what "name" is, or where it's defined.
The answer: by default, the variable $db_url in settings.php is a single connection string. When multiple databases are configured, those strings are placed inside of an array. The key to each value is the "name".
<?php$db_url = array( 'default' => 'mysql://username:password@localhost/drupal_database', 'thirdparty' => 'mysql://username1:password1@localhost/other_database' );?>
Thanks for reporting!
This is a d6-specific bug. In D7 it is documented more clearly (the parameter is called $key and it's documented what it's an array key to).
So we should say that $name is a key into the $db_url global variable from settings.php. Good project for a novice doc contributor...
It would be great if the @return was fixed up too. non -> none, and needs to start with a capital letter.
Just marked#725856: db_set_active() documentation fix . . .
as a duplicate of this issue. It's about the @return section.
+ * The name of the previously active database or FALSE if None was found.
I think this needs a comma before the or, and None should not be capitalized. Sorry if my note about capital letters above confused you -- I meant the @return description needs to start with a capital letter, not the word none. :)
Thank you, doc team! These little improvements make a big difference.
Another report of confusion on this function - should verify this fixes their doc issue too:#1184106: db_set_active doc issues
@jhodgdon, that links back to this same issue..
whoops.#1189212: Documentation problem with db_set_active
That looks fine to me - thanks!
Automatically closed -- issue fixed for 2 weeks with no activity.
This issue has no child issues.
Drupal is a registered trademark of Dries Buytaert.