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 many types of inheritance is there in php? name there?
How to join multiple strings stored in an array into a single string?
What is exception in php?
What is $$ in php?
Where php basically used?
Is php session id unique?
Is facebook still in php?
What is new keyword in php?
What is csrf validation?
How to get the number of characters in a string?
write a program to print [123] [456] [789] note : braces also need to be printed
What is difference between count or sizeof function in php?