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 |
How do you check if an arraylist is empty?
What are the different errors in php?
Php program to generate fibonacci series?
What is session and Cokkies . How it works . tell some thing about Session_id()
Which is useful for method overloading?
How to list all values of submitted fields?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
What does a dependant variable mean?
In mail($param1, $param2, $param3, $param4), the $param2 contains__
Explain me is it possible to destroy a cookie?
How do I start a php session?
How can we destroy the cookie in php?