Re: Booleans

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



on 11/4/02 9:26 AM, scott.marlowe@xxxxxxx 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"



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux