[PHP-DEV] PHP 4.0 Bug #5980: Informix ifx_connect reuses closed connection resource id From: mlemos <email protected>
Date: 08/04/00

From: mlemos <email protected>
Operating system: Linux RH 6
PHP version: 4.0 Latest CVS (05/08/2000)
PHP Bug Type: Misbehaving function
Bug description: Informix ifx_connect reuses closed connection resource id

It seems that when ifx_connect is called twice in the same script using the
same connection parameters it returns the same connection resource id even
when the connection was closed before calling ifx_connect for the second
time.

Try the following example to see the problem.

Function Doit($go)
{
 global $informix_server,$database_name,$database,$user,$password,$some_table;
 
 PutEnv("INFORMIXSERVER=$informix_server");
 if(($connection=ifx_connect($database,$user,$password)))
 {
  if(($result=ifx_query("SELECT * FROM $some_table",$connection)))
   ifx_free_result($result);
  else
   echo "Go $go Query error: ".ifx_errormsg(),"\n";
  ifx_Close($connection);
 }
 else
  echo "Connection error: ".ifx_errormsg(),"\n";
}

 $informix_server="demo_on";
 $database_name="my_database";
 $user="informix";
 $password="informixpassword";
 $some_table="my_table";
 $database="$database_name@$informix_server";
 DoIt(1);
 DoIt(2);

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>