(PHP-centric response)

Open another mySQL connection to the other server, and then use the link
identifier in the subsequent calls to identify which server to use for the
query.....  note that in php if you have two or more connections open, the
calls generally default the link ID to the last connection -opened-, not the
last connection used.  This can be counter-intuitive - for instance, if you
insert a record, and then do the call to get the ID of the record inserted,
you may be querying the wrong server if you don't specify the link ID.

Depending on what you are trying to do, another approach for one-time updates
is to use Microsoft Access (or any ODBC capable tool) - define both tables in
ODBC and use myODBC... you can then do things like joining tables on two
different servers with ease (assuming you have the bandwidth).  

There are also third party software products out there that will allow you to
do joins accross different databases from different vendors running on
different types of servers (oracle, mySQL, msSQL, DB2, etc..) and optimize
the result sets globally so that the entire database is not sent
sever-to-server...
--
Fred Stiening
findanisp.com

On Tue, 7 Jan 2003 10:08:23 -0600, Chris Boget wrote:
>We have a *nix network and on that network we have 2
>web servers.  One for development (server1) and one for
>production (server2).  And on each of those servers we
>have MySQL installed.  Is there a way we can query a
>table on server2 from server1?
>I know that when you are using a database from the mysql
>command line, you can query a table in another database
>just by using select databasename.tablename.  But the
>same method using servername doesn't work.  Is this even
>possible?
>
>thnx,
>Chris





---------------------------------------------------------------------
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

Reply via email to