Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22373 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54684 invoked by uid 1010); 13 Mar 2006 16:28:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54669 invoked from network); 13 Mar 2006 16:28:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2006 16:28:04 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:54233] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 60/BD-55982-29D95144 for ; Mon, 13 Mar 2006 11:28:03 -0500 Received: (qmail 9155 invoked from network); 13 Mar 2006 16:27:59 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 13 Mar 2006 16:27:59 -0000 Message-ID: <44159DED.7070208@zend.com> Date: Mon, 13 Mar 2006 18:29:33 +0200 User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Nick Mitin CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Multiple MySQL Connections From: antony@zend.com (Antony Dovgal) On 13.03.2006 18:05, Nick Mitin wrote: > I was trying to create 2 mysql connections. > > $l1 = mysql_pconnect(“localhost”, “user”, “pass”); > mysql_select_db(“db1”, $l1); > > $l2 = mysql_pconnect(“localhost”, “user”, “pass”); > mysql_select_db(“db1”, $l2); > > The $l1 and $l2 now contains different resource ids (#1, #2), but > > mysql_query(“select * from table”, $l1) somehow uses the second connection. Yes, this is the same connection. This is by design. If you need to open a separate connection - use mysql_connect() with 4th parameter set to TRUE. -- Wbr, Antony Dovgal