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 I retrieve values from one database server and
store them in other database server using PHP?



How can I retrieve values from one database server and store them in other database server using P..

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

Post New Answer

More PHP Interview Questions

Explain what does the unset() function means?

0 Answers  


hi, i have knowledge about PHP/MYSQL,i am fresher M.Sc-IT 2009 pass out,any recruitment in PHP please let me know.

0 Answers  


What do you use php for?

0 Answers  


What are the advantages of PHP over HTML?

11 Answers   Infosys, Torque Infotech,


What is dao in php?

0 Answers  


Explain about the data types in PHP?

0 Answers  


What is the use of Php variables?

0 Answers  


What is isset php?

0 Answers  


What is a static method php?

0 Answers  


is that "enumerated array" equal to "numeric array"?

0 Answers   Maxil Technologies,


why we used type-pool SLIS in ALVs? how many types of windows in scripts?

0 Answers   IBM,


What is array function in javascript?

0 Answers  


Categories