I am trying to hook up an external database to Views in Drupal 6. But am having some difficulties. Here is what I have done:
Added a DB DSN for the the external db to settings.php. (The external MySQL is on a separate machine than the MySQL that runs Drupal.)
Created and enabled a custom module called digir .
Created the info file digir.info.
Created the digir.module (empty right now) .
Created the digir.views.inc files with the following code:
NOTE: that database is digircahe and that table is fish_tissue_digir_cache.
$data = array();
$data['fish_tissue_digir_cache']['table']['group'] = t('DiGIR');
$data['fish_tissue_digir_cache']['table']['base'] = array(
'field' => 'tmpcoredataid',
'title' => t('Taxon'),
'help' => 'This is the species name',
'database' => 'digircache',
$data['fish_tissue_digir_cache']['abbreviation'] = array(
'title' => t('Abbreviation'),
'help' => t('Institution code'),
The function does not define all of the fields in the database. I wanted to see if I could get it to work first.
This is not joined to a Drupal Node as there are millions of records in the database.
I don't know if Views is reading the digir.views.inc file. If I put code in the file that I know will throw an error, nothing happens.
I am not sure where my new database will show up so I have been checking both the "View Type" and "Fields" to no avail.
As you can tell, I am pretty new to Views and Drupal. Any advice would be greatly appreciated. Thanks.