pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lynna Landstreet <lynna@gallery44.org>
To: Elijah O. Alcantara <elijah@asti.dost.gov.ph>
To: pgsql-php@postgresql.org
Subject: Re: Resource id #12
Date: Wed, 14 Jul 2004 15:27:49 -0400
Message-ID: <BD1B0175.15DA%lynna@gallery44.org> (raw)
In-Reply-To: <1089619301.13888.22.camel@Falcon>

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





view thread (6+ messages)

Message-ID: <BD1B0175.15DA%lynna@gallery44.org>
Permalink:  ../BD1B0175.15DA%25lynna@gallery44.org/
Also on:    postgresql.org/message-id/BD1B0175.15DA%lynna@gallery44.org

 · 

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: lynna@gallery44.org, elijah@asti.dost.gov.ph
  Subject: Re: Resource id #12
  In-Reply-To: <BD1B0175.15DA%lynna@gallery44.org>
  References: <1089619301.13888.22.camel@Falcon> <BD1B0175.15DA%lynna@gallery44.org>

* 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