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
Is php better than java?
Write a hello world program using variable?
Which php framework is fastest?
What is the difference between die () and exit () in php?
How to convert strings to upper or lower cases?
Why did you choose this particular career path?
What is htmlentities function in php?
Explain how to run the interactive php shell from the command line interface?
What is data type in php?
How can you tell if a number is even or odd without using any condition or loop?
What does PEAR stands for?
How many ways to include array elements in double-quoted strings using php?
Why should I store logs in a database rather than a file?
How easy is php?
Write an example to remove html tags from a string in php?