You are here: Re: Two MySQL servers, one script « PHP Programming Language « IT news, forums, messages
Re: Two MySQL servers, one script

Posted by Jerim on 08/17/07 14:26

On Aug 17, 9:11 am, Jerim <wyo...@gmail.com> wrote:
> I am attempting to put together one script that pulls data from one
> database on its own server, and data from another database on its own
> server, which is off-site.
>
> Server 1 - Only allows shared memory access to the database. Also
> disallows http:// includes. This is where the database of names is
> stored. This is our internal MySQL server.
>
> Server 2 - Only allows shared memory access to the database. So
> anything that calls the connection has to be on the same server. This
> is our external web server maintained by an outside party.
>
> To get a list of names, I created a PHP page on Server 2 that simply
> includes a script from Server 1. The script on Server 1 connects to
> the database, runs the query and prints the names to the screen. I did
> this, because we wanted the web page on our web server which is Server
> 2, but since the the MySQL on Server 1 only accepts shared memory
> access, the script that called it had to be on the same server.
>
> Now what I want to do is include the ages of each person. That is
> information stored in a MySQL database on Server 2, the web server. I
> can't modify the Script on Server 1 to include the database connection
> on Server 2 since Server 2 also requires shared memory access. So I
> tried putting an include file on Server 2 and calling it from Server
> 1, but Server 2 doesn't allow http:// includes.
>
> Please keep in mind that I have had problems with the include. You
> would think that being an include file, it would have access to all
> the data on the page that called it. I have found this not to be the
> case. The include script that I called, did not recognize variables
> that were declared in the file that was calling it. Perhaps because it
> was on another server? The only solution I could find was to pass the
> variables to the include file through URL. So if I were to put another
> include statement on the original page on Server 2, the off site
> include doesn't have access to that database connection. Any help is
> appreciated.

Tried moving all code from the include to the main file. All I left on
the include file was a connection to the database. Unfortunately, the
main file doesn't seem to be able to recognize the database connection
from the include file. The query only works when it is in the include
file.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация