[PHP3] bug in pgsql? From: Brian Schaffner (BSchaffner <email protected>)
Date: 09/30/98

<disclaimer>it's been a long day</disclaimer>

ok, here's the scenario:

in a file called test1.php3:

<?
        $HOST = "localhost";
        $PORT = "5432";
        $DATABASE = "po";

        Require("test2.php3");

        $conn = pg_Connect($HOST, $PORT, "", "", $DATABASE);
        if ($conn) {
                SomeFunc();
                pg_Close($conn);
        }
?>

here's test2.php3:
<?
function SomeFunc() {
        global $HOST, $PORT, $DATABASE;

        $conn = pg_Connect($HOST, $PORT, "", "", $DATABASE);
        if ($conn) {
                pg_Close($conn);
        }
}
?>

Now, when you run test1.php3 - what happens is that the connection gets
opened, then it calls the function in test2.php3 - which also opens a
connection. SomeFunc() closes it's connection - and somehow this is
affecting the first connection.

My theory is that the connection id's are getting either mis-matched or
reused (improperly). What should happen (I believe) is that the first
connection should get an id of 1, and the second one an id of 2. Yet,
somehow they both end up with 1, causing everything after the nested
pg_Close() to fail.

Does this make sense or is it way past my nap time?

anyone else have this problem?

-brian-

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3