Hi all....
my question is if we have more than one database server and with different type of access rights like on server one we can write and on server 2 and 3 we can't write, we have just reading access.
how to make the connection string for this type of Scenario?
Remember we all the databases are for one application.
any help?
thanks in advance.
how to connect multiple database servers
Moderator: General Moderators
You can create multiple database connections.
You can then query each specific database server by using the resource links you just created.
Code: Select all
$database1 = mysql_connect('severname', $username, $password);
mysql_select_db('database_name', $database1);
$database2 = mysql_connect('servername2', $username2, $password2);
mysql_select_db('database_name2', $database2);Code: Select all
//this will query the $database1 connection
$sample_query = mysql_query("SELECT * FROM `users`", $database1);
//this will query the $database2 connection
$sample_query2 = mysql_query("INSERT INTO `users` VALUES('bob')", $database2);Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.