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 to add 301 redirects in PHP?
how can i develop forum code? any one pleale help me on this question
What does the scope of variables mean?
Is echo a function in php?
What is different types of visibility?
What are the variables in php?
What is the difference between print() and echo() in PHP?
Explain the difference between $message and $$message?
How a constant is defined in a php script?
How would you open a directory for reading in php?
What is the Default syntax used in PHP?
When a conditional statement is ended with an endif?
Explain the difference between array_merge() and array_combine()?
Php being an open source is there any support available to it?
Write a program to display table of a number using php?