How can I retrieve values from one database server and
store them in other database server using PHP?
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 |
I am a 2007 Passed out, Jobless for almost 2.6 years. I am preparing myself as a Php programmer. Will i get a job in Php and can any one guide me please.
how to use particular city location in php?
What are static variables in php?
how to convert PHP code in to java code
Do I need to install php after xampp?
What difference between require() and require_once()?
What does $_files means?
How do you destroy a session?
Write a program to get lcm of two numbers using php?
What is x+ mode in fopen() used for?
Do I need apache for php?
Is php outdated 2019?