RE: [PHP-DB] 2 database connections

From: Date: Mon, 11 Feb 2002 15:54:59 +0000
Subject: RE: [PHP-DB] 2 database connections
Groups: php.db 
Request: Send a blank email to php-db+get-16803@lists.php.net to get a copy of this message
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

« previous php.db (#16803) next »