From: Brent R. Matzelle <bmatzelle@yahoo.com>
To: Heather Johnson <hjohnson@nypost.com>
To: pgsql-php@postgresql.org
Subject: Re: how to determine where a select statement fails
Date: Thu, 26 Jul 2001 11:05:00 -0700 (PDT)
Message-ID: <20010726180500.15047.qmail@web13002.mail.yahoo.com> (raw)
In-Reply-To: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com>
--- Heather Johnson <hjohnson@nypost.com> 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/
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: bmatzelle@yahoo.com, hjohnson@nypost.com
Subject: Re: how to determine where a select statement fails
In-Reply-To: <20010726180500.15047.qmail@web13002.mail.yahoo.com>
References: <00a701c115e5$c0c4c6a0$9d0c10ac@1211.nypost.com> <20010726180500.15047.qmail@web13002.mail.yahoo.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