From: Ferdi on
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.

Many thanks,
Ferdi
From: Karl DeSaulniers on
I would create a PHP file that is stored on each server that you call
from your master server.
In that file that is stored on each server, write the code that
retrieves your data and get/send the response.

Karl

On Jan 18, 2010, at 12:23 AM, 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.
>
> Many thanks,
> Ferdi

Karl DeSaulniers
Design Drumm
http://designdrumm.com

From: Chris on
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/