Re: [PHP-DB] Transferring rows between 2 databases on 2 web servers

[email protected] (Chris)
Newsgroups php.db
Message-ID <[email protected]>
Ferdi wrote:
> Hi Everybody,
> 
> There are n number of web servers all having the same Linux-Apache-MySQL-Php
> setup, with identical databases. Each of these servers functions as a
> billing server at a store of my company. Now I am required to set up a
> master server that will copy all data from each of the store servers. All I
> wish to know is:
> 
> How can a page on the master server obtain data from a store database by
> calling a page located on the store server?
> 
> I do not wish to access a store database directly, but through a page on the
> store server. Specifically, how can a web page get data from another web
> page on another server.

wget (from linux command line)
curl (from linux command line or using the php curl functions)
file_get_contents (php function)
fopen (php function)

There are a number of ways but you'll most likely run into timeout issues.

I think you are much better off writing a script that does it 
command-line and connects to the remote database and pulls the data 
back. Then if the script takes an hour to run you won't have any 
problems - you definitely will if you do it through a web page.

I'd also say security would be easier to implement via direct database 
access (firewalls, mysql user limits, ssl-only connections).

-- 
Postgresql & php tutorials
http://www.designmagick.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.