I created another database and wondering how to access it. I want to access it in display suite and or page content type.

Comments

aaewen’s picture

Bump! I want to know too.

sandeep.kumbhatil’s picture

You can create the new database setting in settings.php as followed :

$databases['newdatabase']['default'] = array(
     'driver' => 'mysql',
     'database' => 'newdatabase',
     'username' => 'username',
     'password' => 'password',
     'host' => 'localhost',
     'prefix' => '',
);

And switch the database by:

db_set_active('newdatabase'); 

And switch it back again by:

db_set_active();

Thank you words will motivate me helping few more developers.

You are the first one to start with.