pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Bax <fbax@sympatico.ca>
To: Chadwick Rolfs <cmr@shell.gis.net>
Cc: pgsql-php@postgresql.org
Subject: Re: passing resource id's through functions
Date: Fri, 11 Jan 2002 11:21:40 -0500
Message-ID: <3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca> (raw)
In-Reply-To: <Pine.SOL.3.96.1020111103856.19632A-100000@shell.gis.net>

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)
>



view thread (13+ messages)  latest in thread

Message-ID: <3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca>
Permalink:  ../3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca/
Also on:    postgresql.org/message-id/3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: fbax@sympatico.ca, cmr@shell.gis.net
  Subject: Re: passing resource id's through functions
  In-Reply-To: <3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca>
  References: <Pine.SOL.3.96.1020111103856.19632A-100000@shell.gis.net> <3.0.6.32.20020111112140.007b2470@pop6.sympatico.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox