Re: Bug #729: mysql_connect reuses connection ids

From: Date: Wed, 09 Sep 1998 17:58:29 +0000
Subject: Re: Bug #729: mysql_connect reuses connection ids
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-887@lists.php.net to get a copy of this message
That's true. I guess we'll have to decide whether we want it to reuse connections or not, perhaps make it toggleable. Zeev At 06:02 09/09/98 -0000, walton@nordicdms.com wrote: >From: walton@nordicdms.com >Operating system: FreeBSD 2.2.6 >PHP version: 3.0.3 >PHP Bug Type: MySQL related >Bug description: >This can cause unpleasant problems when using a library function that cleans up after itself. > >The script: > ><? > function some_reuseable_function() { > // Pretend this function was included from another file > $conn2 = mysql_connect('host', 'uid', 'pwd'); > echo "Function connection is: $conn2<br>\n"; > mysql_close($conn2); > } > >$conn1 = mysql_connect('host', 'uid', 'pwd'); >echo "Main connection is: $conn1<br>\n"; >some_reuseable_function(); >mysql_close($conn1); >?> > >The output: > >Main connection is: 1 >Function connection is: 1 > >Warning: 1 is not a MySQL link index in test.php3 on line 12 > > > > >-- >PHP Development Mailing List http://www.php.net/ >To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net >For help: php-dev-help@lists.php.net > > > -- Zeev Suraski <zeev@php.net> For a PGP public key, finger bourbon@netvision.net.il -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#887) next »