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 the difference between php and javascript?
What is difference between base_url and site_url?
Tell me what are magic methods?
Why is PHP-MySQL frequently used for web (Portal) Development?
5 Answers T3 Softwares, Wipro,
Explain the difference between isset() and empty()?
What is return value in php?
How to upload a file (may be a .txt or a .doc file) from a php script/file?
when will be syndicate bank written exam ? i need the date of exam
How do you use bcrypt for hashing passwords in php?
How can php and html interact?
What is the importance of php?
am fresher in php ..am finished my linux,apache,mysql,and php(LAMP) course please can any one tell openings for freshers in php ...And please tell how much i demand as a fresher in PHP field just say approximately or assumption ..? at present am staying in chennai am looking my job in chennai only or else in bangalore ... hello experts please answer this question ?