Adding external databases to settings.php using prefix As per the comments in settings.php:

/*
 * You can also use a reference to a schema/database as a prefix. This maybe
 * useful if your Drupal installation exists in a schema that is not the default
 * or you want to access several databases from the same code base at the same
 * time.
 * Example:
 * @code
 *   'prefix' =&gt; array(
 *     'default'   =&gt; 'main.',
 *     'users'     =&gt; 'shared.',
 *     'sessions'  =&gt; 'shared.',
 *     'role'      =&gt; 'shared.',
 *     'authmap'   =&gt; 'shared.',
 *   );
 * @endcode
 */


So if my current simple default looks like:

$databases = array (
  'default' =&gt; 
  array (
    'default' =&gt; 
    array (
      'database' =&gt; 'dev',
      'username' =&gt; 'dev',
      'password' =&gt; 'dev',
      'host' =&gt; 'localhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; false,
    ),
  ),
);


How would I add two tables (table1 and table2) on another database (dev1) on localhost so that they are available to drupal?
If they're on the same mysql host (and you've got the appropriate permissions) you can access the tables by simply prefixing them with the schema name: otherdatabasename.tablename. You can even run queries joining across the two databases.

If they're on a different server you'll need to add a separate connection and specify it as part of the query by using the $options['target'] setting.