Re: Resource id #12

From: Lynna Landstreet <lynna(at)gallery44(dot)org>
To: "Elijah O(dot) Alcantara" <elijah(at)asti(dot)dost(dot)gov(dot)ph>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: Resource id #12
Date: 2004-07-14 19:27:49
Message-ID: BD1B0175.15DA%lynna@gallery44.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

on 7/12/04 4:01 AM, Elijah O. Alcantara at elijah(at)asti(dot)dost(dot)gov(dot)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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Christopher Browne 2004-07-15 02:44:52 Re: Secure DB Systems - How to
Previous Message Mitch Pirtle 2004-07-13 14:06:02 Re: [ADMIN] [PHP] Secure DB Systems - How to