Booleans

From: Jascha Schubert <JTSMailing(at)gmx(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: Booleans
Date: 2002-11-04 15:24:22
Message-ID: 200211041624.22853.JTSMailing@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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

Responses

Browse pgsql-php by date

  From Date Subject
Next Message scott.marlowe 2002-11-04 16:26:05 Re: Booleans
Previous Message Keary Suska 2002-11-03 18:19:37 Re: Column names