Organizational Research By

Surprising Reserch Topic

How do you connect to multiple MySQL databases on a single webpage?

 have information spread out across a few databases and want to put all the information onto one webpage using PHP. I was wondering how I can connect to multiple databases on a single PHP webpage.

I know how to connect to a single database using:

$dbh = mysql_connect($hostname, $username, $password) 
        or die("Unable to connect to MySQL");

However, can I just use multiple "mysql_connect" commands to open the other databases, and how would PHP know what database I want the information pulled from if I do have multiple databases connected.

asked May 8, 2015 in PHP by rajesh
0 votes

Related Hot Questions

Government Jobs Opening