How can one pull data from an external database on a shared host in Drupal 6

Got date-nodes and a view1 with database1 for mysite.com and need that view1 also on sub.mysite.com running with database2 without the need to import every date-node in database2

Drupal core 6.22
Calendar 6.x-2.4
Date 6.x-2.7
Views 6.x-2.16
Rotor Banner 6.x-2.8

I tried it with Views 3.x but didn't succeed AND Rotor Banner doesn't work with Views 3.x

1 Answer 1


Do you have the external database setup in your settings.php file?

$db_url['default'] = 'mysqli://user:password@localhost/db';
$db_url['external'] = 'mysqli://user:password@localhost/db2';

You're not attempting a join or create relationships across the databases (more complicated process still under development) so to set this up you can use the Table Wizard module to connect the two. Install the module, and then navigate to "Content Management -> Table Wizard -> Relationships"; you should be able to connect to tables in the 'external' database and use their fields in creating views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.