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 |
What is meant by PEAR in PHP?
What is the difference between the functions unlink and unset?
Suppose the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
What is the use of array_count_values() in php?
What is php and sql used for?
Tell me what does accessing a class via :: means?
How do I display php errors?
How can we display the output directly to the browser?
hi, i have knowledge about PHP/MYSQL,i am fresher of M.Sc-IT 2009 pass out,any recruitment in PHP please let me know.my email id:nathiyasms@gmail.com
What is return value in php?
What is the difference between ereg_replace() and eregi_replace()?
What is session_start () in php?