From: Jascha Schubert <JTSMailing@gmx.net>
To: pgsql-php@postgresql.org
Subject: Booleans
Date: Mon, 4 Nov 2002 16:24:22 +0100
Message-ID: <200211041624.22853.JTSMailing@gmx.net> (raw)
Hi,
I've written an php script with many queries like
"insert into table (a,b,c) VALUES('$q','$w','$e')"
where $q,$w and $e are booleans. I've written it with mysql and it works fine
there, now I want to use it with postgres and have the following problem:
As type for a,b and c I used the bit type with length 1. Now if $q is true
there is now problem it evaluates to '1', but false evaluates to '' and
postgres then complains that the bit string length does not match. Its
clearly why it happens, but is there an easy way to fix this, without
rewriting all the sql queries with something like if($q===false) $q='0';.
Thank you
Jascha Schubert
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: JTSMailing@gmx.net
Subject: Re: Booleans
In-Reply-To: <200211041624.22853.JTSMailing@gmx.net>
References: <200211041624.22853.JTSMailing@gmx.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