Database with Exact Same Name (How to mysql_select_db)

I just had a server made to act as master/slave relationship to the remote mysql server I have now.

Everything was duplicated, even the login info and the database name.

So i have two databases user_dbname.

I have two separate mysql_connect commands, both with just a different remote IP, but how do I “mysql_select_db” when both have the exact same name?


$connect1 = mysql_connect("");
mysql_select_db ("user_dbname");
$connect2 = mysql_connect("");
mysql_select_db ("user_dbname");

What’s the possible solution here?

All feedback appreciated.
Ryan

You have to pass the link identifier in mysql_select_db:



$connect1 = mysql_connect(""); 
mysql_select_db ("user_dbname", $connect1); 
$connect2 = mysql_connect(""); 
mysql_select_db ("user_dbname", $connect2);  


Also, you might want to investigate PDO, it’s the new de facto standard for working with databases in PHP.