Selecting and joining across multiple databases

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
sublimenal
Forum Newbie
Posts: 23
Joined: Sun May 16, 2004 2:17 pm
Location: Massachusetts

Selecting and joining across multiple databases

Post by sublimenal »

I have a problem here.

I have 3 databases that sit ont he same server, I can access the databases seperatly find but what I need to do is access all 3 at the same time. All 3 databases have the same schema. Is it possible to do this? Here is my setup:

My 3 databases: wcmporg_db , alife_db and puritan_db

Here was my thought process on this but it doesnt work

Code: Select all

"SELECT * FROM puritan_db.main,wcmporg_db.main,alife_db.main  ORDER by main.burial_date desc  limit $offset,$limit"
Any help would be appreciated
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Selecting and joining across multiple databases

Post by Christopher »

Are the things three databases or three tables in a database?
(#10850)
sublimenal
Forum Newbie
Posts: 23
Joined: Sun May 16, 2004 2:17 pm
Location: Massachusetts

Re: Selecting and joining across multiple databases

Post by sublimenal »

its 3 different databases they all sthe same schema in each database
sublimenal
Forum Newbie
Posts: 23
Joined: Sun May 16, 2004 2:17 pm
Location: Massachusetts

Re: Selecting and joining across multiple databases

Post by sublimenal »

hmm is it not possible in php?
Post Reply