pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John DeSoi <desoi@pgedit.com>
To: php-db <php-db@lists.php.net>
To: pgsql-php@postgresql.org
Subject: pg_fetch_object
Date: Fri, 23 Sep 2005 20:55:44 -0400
Message-ID: <CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com> (raw)

I'm using PHP 5.0.4, PostgreSQL 8.0.2.

Docs say (http://www.php.net/manual/en/function.pg-fetch-object.php):

object pg_fetch_object ( resource result [, int row [, string  
class_name [, array params]]] )

pg_fetch_object() returns an object with properties that correspond  
to the fetched row's field names. It can optionally instantiate an  
object of a specific class, and pass parameters to that class's  
constructor.

I'm passing a class name string as the third parameter, but I only  
get back a stdClass object. I also added an array of params as the  
4th parameter to pass to the constructor, but it does not appear to  
be called.

Has anyone successfully used this to create a class other than stdClass?

Thanks,


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




view thread (3+ messages)  latest in thread

Message-ID: <CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com>
Permalink:  ../CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com/
Also on:    postgresql.org/message-id/CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com

 · 

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: desoi@pgedit.com, php-db@lists.php.net
  Subject: Re: pg_fetch_object
  In-Reply-To: <CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com>
  References: <CBF7DF3C-1EA0-4A12-8AAB-7934FDCE2D7B@pgedit.com>

* 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