Jump to content

merge data output from 2 mysql databases?


scooter41

Recommended Posts

Hi there...

 

I have a personal site, that I want to combine the blogs of 2 company sites I run, and display them together in one "multi blog" type page.

 

Is it possible to do a select statement from 2 different tables and 2 different databases and output accordingly?

 

I guess if not I would need to put the 2 outputs of data into an array and then merge them.

 

I wanted them to display in date order so hence the reason for wanting to merge rather than execute one query then the other.

 

Thanks for any help in advance!

Ok I have found out how to select another database in the same select statement, which I have as the following:

 

select * from dreamshock.news, scottwright.news order by dreamshock.news.date

 

But this duplicates each record for both tables so I end up with hundreds of each entry... plus I dont really know how to sort by date on both tables at the same time.

 

Me = confused :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.