PHP 4.0 Bug #8907: pg_Close on multiple connections to same host

From: Date: Thu, 25 Jan 2001 15:50:13 +0000
Subject: PHP 4.0 Bug #8907: pg_Close on multiple connections to same host
Groups: php.dev 
Request: Send a blank email to php-dev+get-44991@lists.php.net to get a copy of this message
From: fabbro@conecta.it Operating system: Linux Slackware 7.0 PHP version: 4.0.4 PHP Bug Type: PostgreSQL related Bug description: pg_Close on multiple connections to same host I've found that the following code gives an error <?php $pq_host = "192.168.0.55"; $pq_port = "5432"; $pq_db = "luca"; $pq_user = "postgres"; $pq_pwd = "postgres"; $pq1 = pg_Connect ("host=$pq_host port=$pq_port dbname=$pq_db user=$pq_user password=$pq_pwd"); echo "step1<BR>"; $pq2 = pg_Connect ("host=$pq_host port=$pq_port dbname=$pq_db user=$pq_user password=$pq_pwd"); echo "step2<BR>"; echo "$pq1 $pq2<BR>"; pg_Close ($pq2); echo "back2<BR>"; pg_Close ($pq1); // ^Here it will send a warning echo "back1<BR>"; ?> It seems that pg_Connect or pg_Close doesn't stack or consider the number of open calls. At the first pg_Close it also closes the previous connection. It works fine with PHP 4.0.3pl1 Seems strange as code bat it's very usefull if you wrote general purpose routines to access DB. best regards Luca -- Edit Bug report at: http://bugs.php.net/?id=8907&edit=1

« previous php.dev (#44991) next »