Re: pg_query_params

Lists: pgsql-php
From: Carol Walter <walterc(at)indiana(dot)edu>
To: pgsql-php(at)postgresql(dot)org
Subject: pg_query_params
Date: 2009-07-22 19:12:18
Message-ID: 889FC92A-B6F2-4276-BFD7-E0061ACC73B6@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

Does pg_query_params return a false if an item is not found in at
database?

Carol


From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Carol Walter <walterc(at)indiana(dot)edu>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 19:29:38
Message-ID: 20090722152938.402f6228.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

In response to Carol Walter <walterc(at)indiana(dot)edu>:

> Does pg_query_params return a false if an item is not found in a
> database?

What's an item? That term is does not describe any type of standard
database object.

pg_query_params() will return false if the query was invalid for any
reason. One such possible reason is that you tried to access a
table that doesn't exist.

If you're getting false as the return value, you should use
pg_last_error() to discover the details of the error.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/


From: Carol Walter <walterc(at)indiana(dot)edu>
To:
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 19:37:00
Message-ID: 07E5D103-2E8F-48EE-868E-8DAD10BE0C80@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

No, I mean if I select select a name from the database but the name
isn't found. I'm doing a log in form. I want to check to see if the
user that's logging in exists in my database. I can check the number
of rows returned or something like that, but I wondered if the
function returns a false.

Carol

On Jul 22, 2009, at 3:29 PM, Bill Moran wrote:

> In response to Carol Walter <walterc(at)indiana(dot)edu>:
>
>> Does pg_query_params return a false if an item is not found in a
>> database?
>
> What's an item? That term is does not describe any type of standard
> database object.
>
> pg_query_params() will return false if the query was invalid for any
> reason. One such possible reason is that you tried to access a
> table that doesn't exist.
>
> If you're getting false as the return value, you should use
> pg_last_error() to discover the details of the error.
>
> --
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/


From: "Hajek, Nick" <Nick(dot)Hajek(at)Vishay(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 19:41:24
Message-ID: AFD16ED07E37C64D963DA24840AA31F2065CE337@EVSCO01.na.vishayint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

>
> Does pg_query_params return a false if an item is not found
> in at database?

False means the query didn't execute successfully. A successful query
can return an empty but valid result set.

Nick


From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Carol Walter <walterc(at)indiana(dot)edu>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 19:56:15
Message-ID: 20090722155615.ade61dd4.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

In response to Carol Walter <walterc(at)indiana(dot)edu>:
>
> On Jul 22, 2009, at 3:29 PM, Bill Moran wrote:
>
> > In response to Carol Walter <walterc(at)indiana(dot)edu>:
> >
> >> Does pg_query_params return a false if an item is not found in a
> >> database?
> >
> > What's an item? That term is does not describe any type of standard
> > database object.
> >
> > pg_query_params() will return false if the query was invalid for any
> > reason. One such possible reason is that you tried to access a
> > table that doesn't exist.
> >
> > If you're getting false as the return value, you should use
> > pg_last_error() to discover the details of the error.

> No, I mean if I select select a name from the database but the name
> isn't found. I'm doing a log in form. I want to check to see if the
> user that's logging in exists in my database. I can check the number
> of rows returned or something like that, but I wondered if the
> function returns a false.

Please don't top-post.

I assume that (for some reason) you're avoiding using the term "table"
and that you're running a select query against a table and finding that
a particular row is or is no in that table?

If that's correct, you should work on communicating more clearly. Also,
if that is correct, I already answered your question:

"pg_query_params() will return false if the query was invalid for any
reason."

Meaning, "no, it won't return false if a matching row isn't found, because
the query was still valid."

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/


From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Carol Walter <walterc(at)indiana(dot)edu>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 21:51:02
Message-ID: 4A6789C6.6060905@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

On 22/07/2009 20:37, Carol Walter wrote:
> No, I mean if I select select a name from the database but the name
> isn't found. I'm doing a log in form. I want to check to see if the
> user that's logging in exists in my database. I can check the number of
> rows returned or something like that, but I wondered if the function
> returns a false.

No, it'll still return a rowset (or whatever such things are called in
PHP), but one that doesn't contain any rows.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------


From: Carol Walter <walterc(at)indiana(dot)edu>
To:
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_query_params
Date: 2009-07-22 22:09:10
Message-ID: E342D29B-0457-49E3-B72D-286E2B316C17@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 사이트 순위SQL : Postg토토 사이트 순위SQL 메일 링리스트 : 2009-07-22 이후 PGSQL-PHP 22:09

Thank you very much. I understand.

Carol
On Jul 22, 2009, at 5:51 PM, Raymond O'Donnell wrote:

> On 22/07/2009 20:37, Carol Walter wrote:
>> No, I mean if I select select a name from the database but the name
>> isn't found. I'm doing a log in form. I want to check to see if the
>> user that's logging in exists in my database. I can check the
>> number of
>> rows returned or something like that, but I wondered if the function
>> returns a false.
>
> No, it'll still return a rowset (or whatever such things are called in
> PHP), but one that doesn't contain any rows.
>
> Ray.
>
> ------------------------------------------------------------------
> Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
> rod(at)iol(dot)ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>
> --
> Sent via pgsql-php mailing list (pgsql-php(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php