Jump to content


This topic is now archived and is closed to further replies.


Can you connect to two mysql databases at the same time?

Recommended Posts

yes - just use two (or even more) handles for each DB you're connecting to.

$first_db = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$second_db = mysql_connect('localhost', 'mysql_user2', 'mysql_password2');

and use them as normal.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.