how to determine where a select statement fails - Mailing list pgsql-php

From Heather Johnson
Subject how to determine where a select statement fails
Date
Msg-id 00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com
Whole thread Raw
In response to A function for building a where clause.  ("Ari Nepon" <anepon@verveinternet.com>)
Responses Re: how to determine where a select statement fails
List pgsql-php
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


pgsql-php by date:

Previous
From: GH
Date:
Subject: Re: button tag problem
Next
From: Timothy_Maguire@hartehanks.com
Date:
Subject: Re: how to determine where a select statement fails