PHP: How to evaluate binary variables from a database?

S B

New member
I am trying to have a checkbox checked or not checked on loading a page based on a binary variable read from a database.

The code I am trying to use is (where $centralair holds the binary value):

<?php
$checked;
if($centralair)
{
$checked="checked";
}
?>

Central Air:
<input type="checkbox" name="CentralAir" size="25" <?php echo $checked ?> >

However, the checkbox is always checked. I looked in the database, and it stores binary values with the following characters:

"True" = o
"False" = {rss:Content}

Any help with this would be greatly appreciated.
 
Back
Top