Re: Re: how to determine where a select statement fails

From: "Heather Johnson" <hjohnson(at)nypost(dot)com>
To: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: Re: how to determine where a select statement fails
Date: 2001-07-26 20:13:46
Message-ID: 01ab01c1160f$79fb08e0$9d0c10ac@1211.nypost.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-php

Yes, you're right--I'd have to consider combo cases too. Thanks to everybody
that made suggestions. I guess it's not a really big deal if I can't do
this---was just hoping to add some bells and whistles to a script that
basically works fine as it is. ;)

----- Original Message -----
From: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Sent: Thursday, July 26, 2001 2:56 PM
Subject: Re: [PHP] Re: how to determine where a select statement fails

> What you also have to keep in mind is that one clause is not necessarily
> keeping you from getting zero rows.
>
> For example.
>
> You have st_name and city.
>
> Say you hve 5 entries for a street named "main" and 5 entries for a city
> named "plainfield". But you have NO entries for a street named "main" in
> the city of "plainfield". The fact you are looking for both is what
returns
> zero rows. Individually they exist.
>
> What you are trying to do is nto easy at all. You can't just do if
> statements to see which column has zero rows. You have to also check to
see
> what combo of clauses return ero.
>
> Adam Lang
> Systems Engineer
> Rutgers Casualty Insurance Company
> http://www.rutgersinsurance.com
> ----- Original Message -----
> From: "Heather Johnson" <hjohnson(at)nypost(dot)com>
> To: <Timothy_Maguire(at)hartehanks(dot)com>
> Cc: <pgsql-php(at)postgresql(dot)org>; <pgsql-php-owner(at)postgresql(dot)org>
> Sent: Thursday, July 26, 2001 2:30 PM
> Subject: Re: [PHP] Re: how to determine where a select statement fails
>
>
> > Thanks for the suggestion! I don't really want to do that though b/c the
> > table that I'm searching is pretty large. I was hoping to do only one
> query
> > on the table and then put some indexes on the fields to improve
> performance.
> > But I can't think of a way to structure my code so that I can do just
one
> > query AND get info about which user-entered values don't find a match.
> > (Brent Matzelle suggested that this isn't really a "failure" of the
query,
> > and I guess he's right, so hopefully this describes what I'm talking
about
> a
> > little better).
> >
> > Heather
> > > "Heather Johnson"
> > > <hjohnson(at)nypost(dot)com To:
> > <pgsql-php(at)postgresql(dot)org>
> > > > cc:
> > > Sent by: Subject: how to
> > determine where a select statement
> > > pgsql-php-owner(at)post fails
> > > gresql.org
> > >
> > >
> > > 07/26/01 11:15 AM
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Ebow Halm 2001-07-27 03:21:25 calling pl/pgsql stored procs from php
Previous Message Rene-Raphael 2001-07-26 19:23:17 Re: button tag problem