[PHP-DB] join across databases - how to select databases?

2003-08-22 Thread Moshe Weitzman
I have looked all over the web but can't find an example *in php* for connecting to a mysql server, selecting database(s), and issueing a query which joins across databases. I already know the SQL required to achieve a multiple database query. My question is about how many calls to

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread jeffrey_n_Dyke
] ourmet.org cc: Subject: [PHP-DB] join across databases - how to select

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: Moshe Weitzman [EMAIL PROTECTED] I have looked all over the web but can't find an example *in php* for connecting to a mysql server, selecting database(s), and issueing a query which joins across databases. I already know the SQL required to achieve a multiple database query. My

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] to my knowledge this is not possible in MySQL. There are only joins at the table level. I've been curious about this in the past myself, so if i'm incorrect, i'm hoping to hear it via this post. You can stop hoping now. It is indeed possible. :) mysql select * from

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread Moshe Weitzman
I assume something like the following would work, regardless of whether/how you've called mysql_select_db() SELECT t1.column FROM database1.table1 t1 JOIN database2.table2 t2 ON t1.id = t2.id If you have something working from the MySQL command line, then it's going to work from mysql_query() with