Re: Resource id #12

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



on 7/12/04 4:01 AM, Elijah O. Alcantara at elijah@xxxxxxxxxxxxxxxx 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




[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux