pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roberto Mello <rmello@cc.usu.edu>
To: pgsql-php@postgresql.org
Subject: PEAR and PG
Date: Fri, 20 Apr 2001 10:48:53 -0600
Message-ID: <20010420104853.A20297@cc.usu.edu> (raw)

	Hi there,

	Is anyone here using PEAR with PG? I am having trouble finding decent
documentation about it.
	I have phpdoc.de/pear but the docs there are sketchy at best.

	For example:

  private object a &query( $query )

  Send a query to PostgreSQL and return the results as a DB_result
  object. 


  private int numRows( $result )

  Get the number of rows in a result set


	But if I do (I am a PHP newbie, so bear with me please, and this is
just testing code):

	$sth = $dbh->query("select user_id from users where email='xxxxxx'");

    if($dbh->numrows($sth) > 0) {
        $row = $sth->fetchrow(DB_FETCHMODE_ASSOC);
        print "more than 0 rows. Row is ". $row[0];
    } else {
        print "no rows for you";
    }

	Then it tells me $sth is not a PostgreSQL result set. If it isn't, how
do I get it?

	Thanks,

	-Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
  Roberto Mello - Computer Science, USU - http://www.brasileiro.net 
       http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
(D)inner not ready:  (A)bort (R)etry (P)izza



view thread (2+ messages)  latest in thread

Message-ID: <20010420104853.A20297@cc.usu.edu>
Permalink:  ../20010420104853.A20297@cc.usu.edu/
Also on:    postgresql.org/message-id/20010420104853.A20297@cc.usu.edu

 · 

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: rmello@cc.usu.edu
  Subject: Re: PEAR and PG
  In-Reply-To: <20010420104853.A20297@cc.usu.edu>
  References: <20010420104853.A20297@cc.usu.edu>

* 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