dragonusthei Posted October 18, 2006 Share Posted October 18, 2006 Hi how would i make this work?$db1 = mysql_connect();$db1_select = mysql_select_db();$db2 = mysql_connect();$db2_select = mysql_select_db();//code goes here Link to comment https://forums.phpfreaks.com/topic/24311-connecting-to-2-mysql-databases-problem/ Share on other sites More sharing options...
phil88 Posted October 18, 2006 Share Posted October 18, 2006 Depends what you mean by work?With mysql_select_db(), you can chuck it 2 parameters, the database and the connection to use. So with your code, you could do;$db1 = mysql_connect("Host", "username", "password");$db1_select = mysql_select_db("DatabaseName", $db1);$db2 = mysql_connect("Host", "username", "password");$db2_select = mysql_select_db("DatabaseName", $db2);Obviously replacing host, username, password and databasename with the actual data. Link to comment https://forums.phpfreaks.com/topic/24311-connecting-to-2-mysql-databases-problem/#findComment-110592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.