Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How can i execute PHP File using Command Line?

931


How is it possible to parse a configuration file?

912


Which PHP function would you use to send an email?

984


What is Mcrypt used for?

954


What is static in php?

954


Why do we use query?

883


Tell me whether it is possible to share a single instance of a memcache between multiple php projects?

931


Which is faster for or foreach?

896


Which php framework is best for web development?

918


What is difference Between PHP 5 and 7?

1040


How do you find the length of a string in php?

933


Explain the difference between array_merge() and array_combine()?

949


What is use of mysqli_query in php?

910


What is polymorphism?

2458


What is the difference between get and post in php?

989