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
How do I start a php session?
What is a closure in php?
What is difference between core php and framework?
What are the features of php 7?
Do you know what does $globals means?
What is the difference between rest and soap?
How to get the length of string?
Explain what does the expression exception::__tostring means?
How do you connet mysql database with php?
What are the Formatting and Printing Strings available in PHP?
Tell me how is it possible to return a value from a function?
How do I install php and apache on windows 10?
For image work which library is used in php?
What are php magic quotes?
What is parent __construct ();?