Re: how to determine where a select statement fails

From: "Brent R(dot) Matzelle" <bmatzelle(at)yahoo(dot)com>
To: Heather Johnson <hjohnson(at)nypost(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: how to determine where a select statement fails
Date: 2001-07-26 18:05:00
Message-ID: 20010726180500.15047.qmail@web13002.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

--- Heather Johnson <hjohnson(at)nypost(dot)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/

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Heather Johnson 2001-07-26 18:30:59 Re: Re: how to determine where a select statement fails
Previous Message Timothy_Maguire 2001-07-26 17:24:55 Re: user authentications