Mutiple database query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
wpalm
Forum Newbie
Posts: 1
Joined: Sun Apr 13, 2003 3:56 am

Mutiple database query

Post by wpalm »

I'have a question about 3 large databases in our company on 3 different places. The databases contains the same sort of data like name, street, zip-code and city. The database is an Oracle RDB and runs under (Open)VMS on a Alpha. I have developed an PHP site but I must login 3 times to connect each databases. How can I make a class or procedure that gets its data from the severall databases in one time, display the result and shows from wich database it came.

I connect with a ODBC driver.

Can anyone help me? :?:
User avatar
AlphaWolf
Forum Newbie
Posts: 12
Joined: Sun Mar 23, 2003 8:49 pm

Post by AlphaWolf »

Not exactly sure if I am thinking of your question correctly...but it seems to me you could simply have the following database connection files:
db1_connect.php
db2_connect.php
db3_connect.php

In these files you would have the information you need to make the connections to the DB's to perform your queries.

Then all you would need to do is include the said *.inc files when needed.

If you are then looking to pull similar records from all three, my thought is you could do a join statement against the 3 db's.

I am not 100% sure if this would work...but it seems like it should.

Have you tried something like this all ready?
Post Reply