Old 28-06-2007, 15:37   1 links from elsewhere to this Post. Click to view. #1 (permalink)
greenmop
Registered User
 
greenmop's Avatar
 
Join Date: Mar 2007
Posts: 30
multiple database select in mysql

Hi,

Does anyone knwo how to do the following easily.

I want to select fields from two tables but each table is on a different database on the same server.

I know how to do this in a stored procedure but mysql version is 3. Stored procedures where not available until version 5.

I am looking to do this in PHP but am not sure if this can be done as you can only connect to one database at a time.
  Reply With Quote
Old 28-06-2007, 17:07   #2 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,513
unsure if it's supported in mysql3, but the query syntax is:
Code:
select database1name.tablename.fieldname, database2name.tablename.fieldname, from database1name.tablename, database2name.tablename
__________________
  Reply With Quote
Old 28-06-2007, 22:02   #3 (permalink)
Snowshiro
Will work for Marmite
 
Snowshiro's Avatar
 
Join Date: May 2007
Location: Sapporo, Japan
Posts: 573
How do you persuade the query to run across two concurrent open database connections?
  Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.designerstalk.com/forums/programming/27661-multiple-database-select-mysql.html
Posted By For Type Date
Kaizenlog » Database 02/07/2007 This thread Pingback 01-07-2007 18:31

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8