Received: from ms1.nypost.com ([208.248.87.251]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6QFFjf71127 for ; Thu, 26 Jul 2001 11:15:46 -0400 (EDT) (envelope-from hjohnson@nypost.com) Received: from website (172.16.12.157) by ms1.nypost.com (Worldmail 1.3.167) for pgsql-php@postgresql.org; 26 Jul 2001 11:15:53 -0400 Message-ID: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com> From: "Heather Johnson" To: References: <3B5779FE.74C87025@catalyst.net.nz> Subject: how to determine where a select statement fails Date: Thu, 26 Jul 2001 11:15:06 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Archive-Number: 200107/23 X-Sequence-Number: 480 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