how to do connectivity of 2 dbs in PHP script?
Answers were Sorted based on User's Feedback
Answer / 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 |
What advance thing in php7?
Explain what does $_files means?
What type of headers have to be added in the mail function to attach a file?
Does apache use php?
What is use of header() function in php?
Explain what are the three classes of errors that can occur in php?
Why overriding is called runtime polymorphism?
How to include a file code in different files in php?
What are the method available in form submitting?
Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?
Does php support multithreading?
What are the array functions in php?