Re: query 2 databases from one script
| From: | Fabian Raygosa | Date: | Tue, 03 Apr 2001 22:28:24 +0000 |
| Subject: | Re: query 2 databases from one script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46903@lists.php.net to get a copy of this message | ||
It would help to know the database .... but in Mysql
you can just do this: if you connect to one databaseA, it is possible to
grab info from another databaseB by this format:
SELECT * FROM databaseA.TABLE
while at the same time running this query elsewhere in your functions
SELECT * FROM databaseB.TABLE
basically list thedatabase in front of the table, that should be it
Fabian
----- Original Message -----
From: "Michael Roark" <mroark@verio.net>
To: <php-general@lists.php.net>
Sent: Tuesday, April 03, 2001 3:20 PM
Subject: [PHP] query 2 databases from one script
> I've a script has many functions in it all of which hit databaseA . I've
> added a new function which is to get data from databaseB how can I go
about
> this in one script when I try to connect to a database other than the one
> defined at the beginning of the script all the functions in the script
> break as if I am setting the wrong database at the top of the script. Any
> help would be greatly appreciated.
>
> Michael Roark
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net