how can we retrive value from one database server and store
them another database server using php?
Answer Posted / sunilchai
just connect to the datbase server from php using the
mysql_connect and store the connection identifier in a
variable and then fetch the data from the server and the
close the server connections using mysql_close() and then
connect to another server and insert the value there
/// sample scriopt
$db=mysql_pconnect("host","username","pssword");
mysql_select_db("dtabase name",$db);
$query="select * from the table";
$res=mysql_fetch_object(mysql_query($query));
mysql_close($db);
///connected to the first server fetch the data and stored
in the $res varialble
$db=mysql_pconnect("secondhost","username","pssword");
mysql_select_db("dtabase name",$db);
$query="insert into tablename values($res)";
mysql_close($db);
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
What is basic php?
Explain scalar type declarations in php7?
Is php still relevant 2019?
What is uri routing?
What is a php class?
How break and continue while loop in php?
What is the use of mvc in php?
Explain preg_Match and preg_replace?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What is the meaning of a final class and a final method?
What is php data type?
What is substr in php?
What is the Default syntax used in PHP?
What is magic function in php?
Explain how we can get the number of elements in an array?