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 can I retrieve values from one database server and
store them in other database server using PHP?

Answer Posted / mahesh

$db1 = mysql_connect(”host”,”user”,”pwd”)
mysql_select_db(”db1name;, $db1);
$res1 = mysql_query(”query”,$db1);


$db2 = mysql_connect(”host”,”user”,”pwd”, true)
mysql_select_db(”db2name;, $db2);
$res2 = mysql_query(”query”,$db2);

So mysql_connect has another optional boolean parameter
which indicates whether a link will be created or not. as we
connect to the $db2 with this optional parameter set to
‘true’, so both link will remain live.

now the following query will execute successfully.
$res3 = mysql_query(”query”,$db1);

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is split function in php?

977


How can we change the maximum size of the files to be uploaded?

1045


When use javascript vs php?

1028


What is default session time in php?

992


What is the name of the scripting engine that powers PHP?

1248


How can we change the value of a constant?

990


What is the difference between overloading and overriding in php?

1050


How to join multiple strings into a single string?

971


What is the output of the ucwords function in this example?

1035


What is the correct php command to use to catch any error messages within the code?

1086


Is overloading possible in php?

984


What is the functionality of the functions strstr() and stristr()?

986


Explain briefly about a search-friendly site looks like?

912


Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?

914


How check variable is set or not in php?

899