RE: [PHP] query 2 databases from one script
| From: | Dell Coleman | Date: | Wed, 04 Apr 2001 05:08:38 +0000 |
| Subject: | RE: [PHP] query 2 databases from one script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46975@lists.php.net to get a copy of this message | ||
Hi
You dont say which db you are using, but I assume MYSQL
This may work -
When you log onto the second database it must be a different user (not all
root for example)
make sure you capture the database handle in two different variables
something like
$db1=mysql_connect($blah1,$blah2,$blah3);
$db2=mysql_connect($blah4,$blah5,$blah6);
would be close
HTH
-----Original Message-----
From: Jason Lotito [mailto:Jason@LehighWeb.com]
Sent: Wednesday, April 04, 2001 1:06 AM
To: Plutarck; php-general@lists.php.net
Subject: RE: [PHP] query 2 databases from one script
> "Michael Roark" <mroark@verio.net> wrote in message
> news:5.0.2.1.0.20010403171805.00acf6e0@mail.verio.net...
> > 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
I know this is not the direction you wanted to go, however, I have an
important question. Why would you need 2 databases? What is the stucture,
what are you trying to accomplish with the script, and why the need for 2
databases?
This sounds more like poor database design, and if solved, would avoid such
problems.
Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.
--
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