[PHP-DB] Re: pg_fetch_result returns something other than boolean???

2002-09-04 Thread Yasuo Ohgaki

Matthew Newby wrote:
 I am having trouble with the pg_fetch_result function when trying to access
 a boolean field in a PostgreSQL database.  Here's the code snippet:

It's a spec.

PostgresSQL's boolean is returned as 't' or 'f' and both are string.
Test as string.

--
Yasuo Ohgaki


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: pg_fetch_result returns something other than boolean???

2002-09-04 Thread Matthew Newby

Yasuo Ohgaki [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Matthew Newby wrote:
  I am having trouble with the pg_fetch_result function when trying to
access
  a boolean field in a PostgreSQL database.  Here's the code snippet:

 It's a spec.

 PostgresSQL's boolean is returned as 't' or 'f' and both are string.
 Test as string.

 --
 Yasuo Ohgaki

Yasuo,
Many thanks for the info. I discovered that test yesterday. However, if
that is indeed the way I should test it, then something probably needs to
change in the PHP docs. On the page
http://www.php.net/manual/en/function.pg-fetch-result.php it explicitly
states:

PostgreSQL has many built in types and only the basic ones are directly
supported here. All forms of integer, boolean and void types are returned as
integer values. All forms of float, and real types are returned as float
values. All other types, including arrays are returned as strings formatted
in the same default PostgreSQL manner that you would see in the psql
program.

However, it appears that booleans are NOT returned as integer types, but
rather as single character 't' or 'f', at least as far as PHP is concerned.

Thanks!

-matt



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php