Both of the connections shown below are for the same database server. If both dbs are on the same server you only need one connection, but then you need to use mysql_select_db($database_name,$link1) for each database.
Andrew Hazen -----Original Message----- From: Fred Kamwaza [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 10:21 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: How do I connect to two databases at the same time Thanks for your reply. I am actually using PHP and I tried what you suggested. $link1 = mysql_connect("server1.com", "www", "pass") or die("could ..."); $link2 = mysql_connect("server1.com", "www", "pass") or die("could ..."); there is no error but it is not working. Please not that I am using the same server. Fred Kamwaza. ------------ > I donīt know what API or languaje are you usin, but i think in c, perl, > php you should open two conection with two diferent names > > $link=mysql_connect("192.168.1.11", "www", "pass") or die ("Could not > connect"); > $link2=mysql_connect("192.168.1.10", "www", "pass") or die ("Could not > connect"); > > > and work with the pointers all time > > I think it should work > > >> -----Mensaje original----- >> De: Fred Kamwaza [mailto:[EMAIL PROTECTED]] >> Enviado el: lunes, 10 de junio de 2002 13:22 >> Para: [EMAIL PROTECTED] >> Asunto: How do I connect to two databases at the same time >> >> >> Can you help!! >> >> I have two databases on one MySql sever and I would like to transfer >> certain information from one databases to another. I want to >> transfer, record by record, from a particular table, after examining >> the >> record. How >> can I open the two databases at the same time? >> The only way I am able to do this is by >> >> 1. opening one database - >> 2. read a record from a particular table - >> 3. close the database - >> 4. examine the records - >> 5. open the other database - >> 6. save information and close. >> >> 7. repeat the process for all the records. >> >> I am worried that this may be in efficient. It there another I >> could do it? >> >> >> Fred Kamwaza >> >> --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php