Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why do we need abstract class in php?

957


Tell me how comparison of objects is done in php5?

919


What are the file upload settings in configuration file?

1032


What is final in php?

1077


Tell me how do you define a constant?

944


what is the scope of php in the future if any other language is developed then may be php is loss ???

14524


Are php session secure?

1035


What are the different components used in php for formatting?

1036


Is php front end?

932


How to uploaded files to a table?

994


Do you know what is the differences between $a != $B and $a !== $B?

990


What are the rules to declare a php variables?

1131


How to strip whitespace (or other characters) from the beginning and end of a string?

880


List some features of php that are deprecated in php7?

934


what the new feature add in php 7.2?

966