how to do connectivity of 2 dbs in PHP script?

Answers were Sorted based on User's Feedback



how to do connectivity of 2 dbs in PHP script?..

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

how to do connectivity of 2 dbs in PHP script?..

Answer / naveen das

Simple using two connection objects

Is This Answer Correct ?    3 Yes 0 No

how to do connectivity of 2 dbs in PHP script?..

Answer / manjunath

mysql_query("select db names");

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More PHP Interview Questions

Which php global variable is used for uploading a file?

0 Answers  


What is the difference between laravel and php?

0 Answers  


What is data type in php?

0 Answers  


What is the use of inner join in mysql?

0 Answers  


Is there an easy way to delete an element from a php array?

0 Answers  


how to make website package setup like desktop software setup ... that front end and backend can include in setup like single package...?

0 Answers  


What is the most convenient hashing method to be used to hash passwords?

0 Answers  


This question is regarding version control. If two developers are committing the same php file at same time what will happen ? What error it will show (if any) ?

2 Answers   TCS,


What is the timeout period on session values?

0 Answers  


when will be syndicate bank written exam ? i need the date of exam

0 Answers  


What are the different loops in php?

0 Answers  


How many ways there are to fetch the data from the Database?

2 Answers   Tops Technologies,


Categories