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

From Brent R. Matzelle
Subject Re: how to determine where a select statement fails
Date
Msg-id 20010726180500.15047.qmail@web13002.mail.yahoo.com
Whole thread Raw
In response to how to determine where a select statement fails  ("Heather Johnson" <hjohnson@nypost.com>)
List pgsql-php
--- 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/

pgsql-php by date:

Previous
From: Timothy_Maguire@hartehanks.com
Date:
Subject: Re: user authentications
Next
From: "Heather Johnson"
Date:
Subject: Re: Re: how to determine where a select statement fails