Received: from tomts11-srv.bellnexxia.net (tomts11.bellnexxia.net [209.226.175.55]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0BGMRB43690 for ; Fri, 11 Jan 2002 11:22:28 -0500 (EST) (envelope-from fbax@sympatico.ca) Received: from ACER ([65.93.1.15]) by tomts11-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with SMTP id <20020111162232.YHFL16876.tomts11-srv.bellnexxia.net@ACER>; Fri, 11 Jan 2002 11:22:32 -0500 Message-Id: <3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Fri, 11 Jan 2002 11:21:40 -0500 To: Chadwick Rolfs From: Frank Bax Subject: Re: passing resource id's through functions Cc: pgsql-php@postgresql.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200201/9 X-Sequence-Number: 816 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@gis.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@postgresql.org) >