Re: PHP 4.0 Bug #5980 Updated: Informix ifx_connect reuses closed connection resource id

From: Date: Sun, 06 Aug 2000 00:59:32 +0000
Subject: Re: PHP 4.0 Bug #5980 Updated: Informix ifx_connect reuses closed connection resource id
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-27866@lists.php.net to get a copy of this message
Hello Bug, On 05-Aug-00 11:10:09, you wrote: >ID: 5980 >Updated by: danny >Reported By: mlemos@acm.org >Status: Analyzed >Bug Type: Misbehaving function >Assigned To: danny >Comments: >It looks like it could be a Zend problem. >The code is essentially unchanged since PHP3 where it works. Yes, I can confirm that it is a PHP 4 specific problem, not PHP 3's. >The resource is deleted on ifx_close but somehow Zend >manages to find it again on connect() so the driver thinks it still is active >and reuses it. Connect() will *always* check if a connection does not already >exist in an attempt to save connections. >The (p)connect()/close() code is the same as in mysql, does the same happen >with mysql ? No, but under PHP 3 different MySQL connection resource ID are returned by mysql_connect() and under PHP 4 it is the same resource id. So, I am not sure what needs to be fixed. You can try with this MySQL version. Function Doit($go) { global $host,$database_name,$user,$password,$some_table; if(($connection=mysql_connect($host,$user,$password))) { echo "Connection: $connection\n"; if(($result=mysql_db_query($database_name,"SELECT * FROM $some_table",$connection))) mysql_free_result($result); else echo "Go $go Query error: ".mysql_error($connection),"\n"; mysql_Close($connection); } else echo "Connection error: ".mysql_error(),"\n"; } $database_name="test"; $host="localhost"; $user="root"; $password=""; $some_table="test"; DoIt(1); DoIt(2); Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.dev (#27866) next »