How can I retrieve values from one database server and
store them in other database server using PHP?



How can I retrieve values from one database server and store them in other database server using P..

Answer / 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

More PHP Interview Questions

how we can use lamp.ie installatiion and basic workings.Is it similar to wamp in usage?

1 Answers  


What is The difference between ' and " where they can ben in between or outmost and how

2 Answers   Avis Software,


Explain how to run the interactive php shell from the command line interface?

0 Answers  


Write a program to find a string is palindrome or not?

0 Answers  


code to see the priview of the image which is being uploaded (after browising the image... just click priview ... how it will be visible...before uploading)

0 Answers   Satyam,






What is the timeout period on session values?

0 Answers  


How can php and html interact?

0 Answers  


How to create reusable code in php?

0 Answers  


Is php case sensitive?

0 Answers  


How to terminate the execution of a script in PHP?

0 Answers  


Is array function in php?

0 Answers  


What is get and post method in php?

0 Answers  


Categories