Re: RE: Best Practices? [PHP-DB] Queries from two databases
| From: | Chris | Date: | Thu, 19 Jul 2007 23:05:03 +0000 |
| Subject: | Re: RE: Best Practices? [PHP-DB] Queries from two databases | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43817@lists.php.net to get a copy of this message | ||
Instruct ICC wrote:
If you only ever deal with mysql then you'll be fine. Other databases may or may not support this feature. The other problem could be user 'A' has access to DB1 but no access to DB2. So you have to connect as user 'B' to be able to read from DB2. So - as usual - "it depends" is the answer. -- Postgresql & php tutorials http://www.designmagick.com/From: Joaquín <javalpi@gmail.com> I need query tables that are in two different databases mysql_select_db("DB1", $conn_1); mysql_select_db("DB2", $conn_2); $result_t1 = mysql_query("SELECT * FROMAlthough Joaquín said his issue is [Fixed], I write these queries as: SELECT * FROM DB1.TableInDB1 SELECT * FROM DB2.TableInDB2 (with and without link_identifiers I believe), so I was wondering about best practices.Table1inDB1",$conn_1); $row_t1 = mysql_fetch_assoc($result_t1); $result_t2 = mysql_query("SELECT * FROMTable2inDB2",$conn_2); $row_t2 = mysql_fetch_assoc($result_t2);