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
How do you identify independent and dependent variables in research?
How to merge values of two arrays into a single array?
what is benefit of magento?
How to Retrieve a Cookie Value?
What is the use of @ in php?
Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?
Tell me what kind of things have you done on the social side?
What is isset in php form?
What are the rules for naming a php variable?
How many types of php frameworks are there?
What is pdo classes?
What is the main function of php?
What is the purpose of the php empty function?
How cookies are transported from servers to browsers?
Does php need html?