pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_query_params
7+ messages / 4 participants
[nested] [flat]
* pg_query_params
@ 2009-07-22 19:12 Carol Walter <walterc@indiana.edu>
0 siblings, 2 replies; 7+ messages in thread
From: Carol Walter @ 2009-07-22 19:12 UTC (permalink / raw)
To: pgsql-php
Does pg_query_params return a false if an item is not found in at
database?
Carol
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 19:29 Bill Moran <wmoran@potentialtech.com>
parent: Carol Walter <walterc@indiana.edu>
1 sibling, 1 reply; 7+ messages in thread
From: Bill Moran @ 2009-07-22 19:29 UTC (permalink / raw)
To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-php
In response to Carol Walter <walterc@indiana.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/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 19:37 Carol Walter <walterc@indiana.edu>
parent: Bill Moran <wmoran@potentialtech.com>
0 siblings, 2 replies; 7+ messages in thread
From: Carol Walter @ 2009-07-22 19:37 UTC (permalink / raw)
To: ; +Cc: 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@indiana.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/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 19:41 Hajek, Nick <Nick.Hajek@Vishay.com>
parent: Carol Walter <walterc@indiana.edu>
1 sibling, 0 replies; 7+ messages in thread
From: Hajek, Nick @ 2009-07-22 19:41 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 19:56 Bill Moran <wmoran@potentialtech.com>
parent: Carol Walter <walterc@indiana.edu>
1 sibling, 0 replies; 7+ messages in thread
From: Bill Moran @ 2009-07-22 19:56 UTC (permalink / raw)
To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-php
In response to Carol Walter <walterc@indiana.edu>:
>
> On Jul 22, 2009, at 3:29 PM, Bill Moran wrote:
>
> > In response to Carol Walter <walterc@indiana.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/
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 21:51 Raymond O'Donnell <rod@iol.ie>
parent: Carol Walter <walterc@indiana.edu>
1 sibling, 1 reply; 7+ messages in thread
From: Raymond O'Donnell @ 2009-07-22 21:51 UTC (permalink / raw)
To: Carol Walter <walterc@indiana.edu>; +Cc: 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@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pg_query_params
@ 2009-07-22 22:09 Carol Walter <walterc@indiana.edu>
parent: Raymond O'Donnell <rod@iol.ie>
0 siblings, 0 replies; 7+ messages in thread
From: Carol Walter @ 2009-07-22 22:09 UTC (permalink / raw)
To: ; +Cc: pgsql-php
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@iol.ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>
> --
> Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-php
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2009-07-22 22:09 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 19:12 pg_query_params Carol Walter <walterc@indiana.edu>
2009-07-22 19:29 ` Bill Moran <wmoran@potentialtech.com>
2009-07-22 19:37 ` Carol Walter <walterc@indiana.edu>
2009-07-22 19:56 ` Bill Moran <wmoran@potentialtech.com>
2009-07-22 21:51 ` Raymond O'Donnell <rod@iol.ie>
2009-07-22 22:09 ` Carol Walter <walterc@indiana.edu>
2009-07-22 19:41 ` Hajek, Nick <Nick.Hajek@Vishay.com>
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