Re: 2 database connections
| From: | David Fudge | Date: | Mon, 11 Feb 2002 16:12:39 +0000 |
| Subject: | Re: 2 database connections | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16804@lists.php.net to get a copy of this message | ||
it's difficult to diagnose a problem without code or errors... any examples
you'd like to share?
----- Original Message -----
From: "Rick Emery" <remery@excel.com>
To: "[PHP-DB]" <php-db@lists.php.net>
Sent: Monday, February 11, 2002 10:54 AM
Subject: RE: [PHP-DB] 2 database connections
> If the two databases are on the same server, you do not execute
> mysql_connect() twice.
>
> $conn = mysql_ connect("host","user","password");
> $db1 = mysql_select_db("database1",$conn);
> $db2 = mysql_select_db("database2",$conn);
>
> -----Original Message-----
> From: Jeroen Timmers [mailto:maillist@start4me.nl]
> Sent: Monday, February 11, 2002 9:46 AM
> To: David Fudge
> Cc: [PHP-DB]
> Subject: Re: [PHP-DB] 2 database connections
>
>
> yeah
> but when i want a query on db1 i got the error ?
>
> how must that then ?
>
> Jeroen
>
> ----- Original Message -----
> From: "David Fudge" <fudge@hostopia.com>
> To: "Jeroen Timmers" <maillist@start4me.nl>; "[PHP-DB]"
> <php-db@lists.php.net>
> Sent: Monday, February 11, 2002 4:44 PM
> Subject: Re: [PHP-DB] 2 database connections
>
>
> > yes, you just open both connections. =)
> > $db1 = mysql_connect($host1,$user1,$pass1);
> > $db2 = mysql_connect($host2,$user2,$pass2);
> > careful tho, you can't use two defines to do this. i'm pretty sure it's
a
> > bug in php4.
> >
> > ----- Original Message -----
> > From: "Jeroen Timmers" <maillist@start4me.nl>
> > To: "[PHP-DB]" <php-db@lists.php.net>
> > Sent: Monday, February 11, 2002 10:36 AM
> > Subject: [PHP-DB] 2 database connections
> >
> >
> > Hello,
> >
> > is there a way to connect to two databases on the same session?
> >
> > Jeroen
> >
> >
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>