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 to register website in internet
What are the uses of implode() function?
How do you check if an arraylist is empty?
What are the different loops in php?
What is htaccess? Why do we use this and where?
How to uploaded files to a table?
What are the environmental variables?
hey i m a trainee n jus wanted to ask that initially i was given the opportunity for .NET bt that project is abt to complete , nw i m asked to join a project of php on linux which is about to start , so wt say . is it a wise decision to join this project . will i be having job opportunities when i l complete my training after 4 months ? Plz suggest something ASAP .
When to use single quotes, double quotes, and backticks?
How to get a total number of rows available in the table?
What is put method in php?
What are the differences between procedure-oriented languages and object-oriented languages?