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
Tell me what is the use of the function htmlentities?
write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.
Which of the delimiter is ASP style?
Write a program to find the factorial of a number in php?
Which is best framework for php?
Do you know what are traits?
in PHP for pdf which library used?
What is move_uploaded_file in php?
Does php have block scope?
Explain how to submit form without a submit button.
What's the difference between using mysql_ functions and pdo?
How to redirect a page in php?
What does the scope of variables means?
What is default session time in php?
What are global variables in php?