Drupal Setup to use another database


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // settings.php
  2. $db_url['default'] = 'pgsql://user:pass@localhost/default_database';
  3. $db_url['another_db'] = 'pgsql://user:pass@localhost/another_database';
  4.  
  5.  
  6. // To use
  7. db_set_active('another_db');
  8. // do whatever
  9. db_set_active('default');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.