pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedResource id #12
6+ messages / 5 participants
[nested] [flat]
* Resource id #12
@ 2004-07-12 05:20 Elijah O. Alcantara <elijah@asti.dost.gov.ph>
0 siblings, 2 replies; 6+ messages in thread
From: Elijah O. Alcantara @ 2004-07-12 05:20 UTC (permalink / raw)
To: pgsql-php
Mind if I ask another question? I've been logging errors lately and
found a 'Resource id #12' in one of the query results, what does this
mean?
Elijah
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Resource id #12
@ 2004-07-12 07:38 Andrew McMillan <andrew@catalyst.net.nz>
parent: Elijah O. Alcantara <elijah@asti.dost.gov.ph>
1 sibling, 1 reply; 6+ messages in thread
From: Andrew McMillan @ 2004-07-12 07:38 UTC (permalink / raw)
To: Elijah O. Alcantara <elijah@asti.dost.gov.ph>; +Cc: pgsql-php
On Mon, 2004-07-12 at 13:20 +0800, Elijah O. Alcantara wrote:
> Mind if I ask another question? I've been logging errors lately and
> found a 'Resource id #12' in one of the query results, what does this
> mean?
That's what you get when you try and print something that shouldn't
really be printed. Generally complex objects where there is little
value implementing some more complex behaviour when passed to the print
routines.
Knowing the id# is about as useful as it can get, for when you need to
see if it's the same resource as a different whatever-it-is.
Cheers,
Andrew.
-------------------------------------------------------------------------
Andrew @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)803-2201 MOB: +64(272)DEBIAN OFFICE: +64(4)499-2267
Make things as simple as possible, but no simpler -- Einstein
-------------------------------------------------------------------------
Attachments:
signature.asc (application/pgp-signature, 188B) download
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Resource id #12
@ 2004-07-12 08:01 Elijah O. Alcantara <elijah@asti.dost.gov.ph>
parent: Andrew McMillan <andrew@catalyst.net.nz>
0 siblings, 2 replies; 6+ messages in thread
From: Elijah O. Alcantara @ 2004-07-12 08:01 UTC (permalink / raw)
To: pgsql-php
Something that shouldn't be printed ... hmmm.. does the postgresql site
have a list of these Resource id's? I've been looking all over google
for this and found nothing. =(
Elijah
On Mon, 2004-07-12 at 15:38, Andrew McMillan wrote:
> On Mon, 2004-07-12 at 13:20 +0800, Elijah O. Alcantara wrote:
> > Mind if I ask another question? I've been logging errors lately and
> > found a 'Resource id #12' in one of the query results, what does this
> > mean?
>
> That's what you get when you try and print something that shouldn't
> really be printed. Generally complex objects where there is little
> value implementing some more complex behaviour when passed to the print
> routines.
>
> Knowing the id# is about as useful as it can get, for when you need to
> see if it's the same resource as a different whatever-it-is.
>
> Cheers,
> Andrew.
>
> -------------------------------------------------------------------------
> Andrew @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
> WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
> DDI: +64(4)803-2201 MOB: +64(272)DEBIAN OFFICE: +64(4)499-2267
> Make things as simple as possible, but no simpler -- Einstein
> -------------------------------------------------------------------------
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Resource id #12
@ 2004-07-12 08:18 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
parent: Elijah O. Alcantara <elijah@asti.dost.gov.ph>
1 sibling, 0 replies; 6+ messages in thread
From: Christopher Kings-Lynne @ 2004-07-12 08:18 UTC (permalink / raw)
To: Elijah O. Alcantara <elijah@asti.dost.gov.ph>; +Cc: pgsql-php
> Something that shouldn't be printed ... hmmm.. does the postgresql site
> have a list of these Resource id's? I've been looking all over google
> for this and found nothing. =(
That's because it's nothing to do with Postgres. Try reading the PHP docs.
Chris
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Resource id #12
@ 2004-07-12 14:46 Scott Marlowe <smarlowe@qwest.net>
parent: Elijah O. Alcantara <elijah@asti.dost.gov.ph>
1 sibling, 0 replies; 6+ messages in thread
From: Scott Marlowe @ 2004-07-12 14:46 UTC (permalink / raw)
To: Elijah O. Alcantara <elijah@asti.dost.gov.ph>; +Cc: pgsql-php
On Sun, 2004-07-11 at 23:20, Elijah O. Alcantara wrote:
> Mind if I ask another question? I've been logging errors lately and
> found a 'Resource id #12' in one of the query results, what does this
> mean?
A "Resource id #12" is a handle to a resource in PHP. It comes from
something like this:
$conn = pg_connect("...
$query = "select * from sometable";
$res = pg_query ($conn,$query);
$res will now have something like "Resource id #12" in it. I.e. it's
not some constant that means anything, it's a handle to the result set
php now has in memory and what you use to access it via the
pg_fetch_array functions et. al.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Resource id #12
@ 2004-07-14 19:27 Lynna Landstreet <lynna@gallery44.org>
parent: Elijah O. Alcantara <elijah@asti.dost.gov.ph>
1 sibling, 0 replies; 6+ messages in thread
From: Lynna Landstreet @ 2004-07-14 19:27 UTC (permalink / raw)
To: Elijah O. Alcantara <elijah@asti.dost.gov.ph>; pgsql-php
on 7/12/04 4:01 AM, Elijah O. Alcantara at elijah@asti.dost.gov.ph wrote:
> Something that shouldn't be printed ... hmmm.. does the postgresql site
> have a list of these Resource id's? I've been looking all over google
> for this and found nothing. =(
The number doesn't mean anything - it just labels a specific resource that's
stored in a variable, which could be a database connection or a result set
or any of several other things.
I've found that the most common reason for running into a resource ID
reference is that I've tried to treat a result set as if it were an array in
my code, without having done a pg_fetch_row() or pg_fetch_all() or whatever
on it first. I'd suggest seeing what variable contains the resource, and
then looking back in your code to see when that variable was defined and
what it might contain. If it is a result set, use one of the above functions
to turn it into an array before trying to print it.
Of course, there are other tricks to printing an array, but that depends on
what you're trying to do with it. If you just want to see what's in it, the
simplest way is to use print_r().
Lynna
--
Resource Centre Database Coordinator
Gallery 44: www.gallery44.org
Database Project: www.gallery44db.org
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2004-07-14 19:27 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-12 05:20 Resource id #12 Elijah O. Alcantara <elijah@asti.dost.gov.ph>
2004-07-12 07:38 ` Andrew McMillan <andrew@catalyst.net.nz>
2004-07-12 08:01 ` Elijah O. Alcantara <elijah@asti.dost.gov.ph>
2004-07-12 08:18 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-07-14 19:27 ` Lynna Landstreet <lynna@gallery44.org>
2004-07-12 14:46 ` Scott Marlowe <smarlowe@qwest.net>
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