Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 61B28476305 for ; Mon, 4 Nov 2002 10:23:49 -0500 (EST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id A2DA34762C5 for ; Mon, 4 Nov 2002 10:23:47 -0500 (EST) Received: (qmail 20686 invoked by uid 0); 4 Nov 2002 15:23:51 -0000 Received: from pd9e1570f.dip.t-dialin.net (HELO teslaVM.zeggnet.de) (217.225.87.15) by mail.gmx.net (mp006-rz3) with SMTP; 4 Nov 2002 15:23:51 -0000 From: Jascha Schubert To: pgsql-php@postgresql.org Subject: Booleans Date: Mon, 4 Nov 2002 16:24:22 +0100 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200211041624.22853.JTSMailing@gmx.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/3 X-Sequence-Number: 1585 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