pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Randall Perry <rgp@systame.com>
To: pgsql-interfaces@postgresql.org
Subject: how to  use $result->ruseltStatus
Date: Mon, 07 May 2001 22:12:18 -0400
Message-ID: <B71CCE41.B1D3%rgp@systame.com> (raw)

I want to make sure queries returned aren't empty. Tried this:

    $conn = Pg::connectdb("dbname=$db");
    $res  = $conn->exec("$q");
    $result_status = $res->resultStatus;
    ($result_status != PGRES_EMPTY_QUERY) ? print "query not empty\n" :
print "query empty\n";

But it returns '2' (not sure which constant it is, but it's not
PGRES_EMPTY_QUERY) on empty queries.

What's the right use of this property?


-- 
Randy Perry
sysTame
Mac Consulting/Sales





view thread (2+ messages)  latest in thread

Message-ID: <B71CCE41.B1D3%rgp@systame.com>
Permalink:  ../B71CCE41.B1D3%25rgp@systame.com/
Also on:    postgresql.org/message-id/B71CCE41.B1D3%rgp@systame.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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: rgp@systame.com
  Subject: Re: how to  use $result->ruseltStatus
  In-Reply-To: <B71CCE41.B1D3%rgp@systame.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