From: Keary Suska <hierophant@pcisys.net>
To: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: Booleans
Date: Mon, 04 Nov 2002 10:27:10 -0700
Message-ID: <B9EBFBFE.14F7B%hierophant@pcisys.net> (raw)
In-Reply-To: <Pine.LNX.4.33.0211040922510.21951-100000@css120.ihs.com>
on 11/4/02 9:26 AM, scott.marlowe@ihs.com purportedly said:
> To set your values, I'd suggest using the TRUE and FALSE method, like so:
>
> insert into table (a,b,c) values (TRUE,FALSE,FALSE)
>
> So that you use PHP to set each field to TRUE or FALSE (note there's no '
> marks around the TRUE or FALSE).
This would work only if the fields are boolean. Unfortunately, bit fields
are a poor choice to store boolean values, and you don't get any real
benefit from them.
You will have to force PHP to convert your values into a number, such as
$a = $a|0 or $a = number_format( $a )
or use the workaround mentioned in your original email.
You should also use proper bit string constant syntax, prefacing each value
with "B":
insert into table (a,b,c) values (B'$a',B'$b',B'$c')
Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: hierophant@pcisys.net
Subject: Re: Booleans
In-Reply-To: <B9EBFBFE.14F7B%hierophant@pcisys.net>
References: <Pine.LNX.4.33.0211040922510.21951-100000@css120.ihs.com> <B9EBFBFE.14F7B%hierophant@pcisys.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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