how to do connectivity of 2 dbs in PHP script?

Answer Posted / lt

If you are trying to open multiple, separate MySQL
connections with the same MySQL user, password, and
hostname, you must set $new_link = TRUE to prevent
mysql_connect from using an existing connection.
The workaround is to require that the second MySQL
connection is new:

$db1 = mysql_connect($dbhost, $dbuser, $dbpass);
$rv = mysql_select_db($dbname1, $db1);
$db2 = mysql_connect($dbhost, $dbuser, $dbpass, TRUE);
$rv = mysql_select_db($dbname2, $db2);
Source: http://jp2.php.net/manual/en/function.mysql-connect.php
Message from: arithmetric at gmail dot com
26-Mar-2008 03:59

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does php need server?

519


How to turn on the session support in php?

528


What is the difference between $name and $$name?

523


What are php variables?

515


What is a composer?

530






Where is php code written?

513


What are the differences between require and include?

567


What are the features and advantages of object-oriented programming in php?

490


Can we learn php without html?

546


How to return a value back to the function caller?

556


How to get ip address of a server in php?

545


What are headers in php?

526


What is session cookies php?

547


How can you increase the maximum execution time of a script in php?

517


What is the purpose of the php empty function?

488