Received: from web13002.mail.yahoo.com (web13002.mail.yahoo.com [216.136.174.12]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6QI52f48651 for ; Thu, 26 Jul 2001 14:05:03 -0400 (EDT) (envelope-from bmatzelle@yahoo.com) Message-ID: <20010726180500.15047.qmail@web13002.mail.yahoo.com> Received: from [146.145.232.35] by web13002.mail.yahoo.com; Thu, 26 Jul 2001 11:05:00 PDT Date: Thu, 26 Jul 2001 11:05:00 -0700 (PDT) From: "Brent R. Matzelle" Subject: Re: how to determine where a select statement fails To: Heather Johnson , pgsql-php@postgresql.org In-Reply-To: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200107/28 X-Sequence-Number: 485 --- Heather Johnson wrote: > 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. I'm not sure if I understand what your problem is. If a query does not return any rows (pg_numrows() < 1) then that is not really a "failure". If the SQL was incorrect then I would suggest printing it to the browser (echo $query) and pasting it in a query program like psql or winsql to determine which line of code was incorrect. Brent __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/