in joomla whether we can use two mysql databases for a single project?
by Administrator on Monday, February 23rd, 2009 | 1 Comment
a117.jpg”>
Aarmin J bupropion online rx asked:
in my joomla project i want to insert data to two mysql database…….
is it possible in joomla?
Different Kinds Of Web 2.0 Sites
in my joomla project i want to insert data to two mysql database…….
is it possible in joomla?
Different Kinds Of Web 2.0 Sites


Jumpstart your Joomla Websites - Click for Details
You cannot split your *Joomla* data into different database. However if you want to access another database within your own component, that’s possible.
This is how you can connect to your own database :
# Set your database connection
$driver = ‘mysql’;
$host = ‘your_host_name’;
$user = ‘yourdatabase_user’;
$password = ’123456′;
$database = ‘yourdatabase_name’;
$prefix = ”;
$options= array ( ‘driver’ => $driver, ‘host’ => $host, ‘user’ => $user, ‘password’ => $password, ‘database’ => $database, ‘prefix’ => $prefix );
$db =& JDatabase::getInstance( $options );
# Go ahead and work with your database
$query = “SELECT whatever FROM yourtable”;
$db->setQuery( $query );
$result = $db->loadObject();
Please, specify if it is what you wanted ?!