php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8907 pg_Close on multiple connections to same host
Submitted: 2001-01-25 10:50 UTC Modified: 2001-02-13 12:13 UTC
From: fabbro at conecta dot it Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.4 OS: Linux Slackware 7.0
Private report: No CVE-ID: None
 [2001-01-25 10:50 UTC] fabbro at conecta dot it
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-13 12:13 UTC] thies@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC