pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heather Johnson <hjohnson@nypost.com>
To: pgsql-php@postgresql.org
Subject: how to determine where a select statement fails
Date: Thu, 26 Jul 2001 11:15:06 -0400
Message-ID: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com> (raw)
References: <JMEEKPBGBOBMKNANAGILKECACEAA.anepon@verveinternet.com>
	<3B5779FE.74C87025@catalyst.net.nz>

I am using php to do a select query which returns rows on the condition that
a conjunction is true in the WHERE clause. This is the SELECT statement:

SELECT low_range, high_range, st_name, city, zip FROM router
WHERE st_name = '$st_name' AND city = '$city' AND zip = '$zip';

In the event that the query fails to return any rows, I'd like to be able to
determine which conjunct caused it to fail. So, for example, if the
user-entered $st_name isn't in the router table, I'd like to know that
st_name = '$st_name' is what made the conjunction false and caused the query
to fail. $pg_errormsg isn't this specific about query failures though. Does
anyone know how I might be able to get this information?

Thanks!
Heather Johnson




view thread (9+ messages)  latest in thread

Message-ID: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com>
Permalink:  ../00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com/
Also on:    postgresql.org/message-id/00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.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: hjohnson@nypost.com
  Subject: Re: how to determine where a select statement fails
  In-Reply-To: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com>
  References: <JMEEKPBGBOBMKNANAGILKECACEAA.anepon@verveinternet.com> <3B5779FE.74C87025@catalyst.net.nz> <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.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