From: | Frank Bax <fbax(at)sympatico(dot)ca> |
---|---|
To: | Chadwick Rolfs <cmr(at)shell(dot)gis(dot)net> |
Cc: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: passing resource id's through functions |
Date: | 2002-01-11 16:21:40 |
Message-ID: | 3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
I never had any problems with pg_pconnect either. When I switched to
pg_connect I only had isolated problems, most of the time I was able to
pass it to functions, but sometime the script would die.
I use the PHPLIB DB abstraction classes rather than pg_connect directly,
but I don't think that's a factor here.
$dbc = new DB_Example /* calls pg_connect() */
$func1($dbc);
$func2($dbc);
If func1 contains two calls to $dbc->query() (invokes pg_exec($dbc,..))
then func2 will fail ($dbc not a resource), otherwise func2 works properly.
However, I have not yet been able to properly resolve the problem.
Frank
At 10:44 AM 1/11/02 -0500, Chadwick Rolfs wrote:
>I seem to have figured out that pg_connect returns a resource ID that will
>not pass into another function, and that pg_pconnect does. I'm not too
>keen on the persistent connections. Can someone confirm this belief? I'm
>trying to remember where on php.net I read how to pass pg_connect
>resources to other functions, and haven't found it at functions,
>persistent connections, pg_connect or pg_pconnect.
>
>Any help would be appreciated, and helpful :)
>
>Chadwick Rolfs - cmr(at)gis(dot)net
>Cleveland State University - Student
>Music Major - The Holden Arboretum Volunteer
>Computer Programmer - Student Employee
>--*I finally found powdered water;
>I just can't figure out what to add to it*--
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Chadwick Rolfs | 2002-01-11 16:25:04 | Re: passing resource id's through functions |
Previous Message | Chadwick Rolfs | 2002-01-11 15:44:05 | passing resource id's through functions |