I'm using PHP to read if an entry in my table on the database is set to "yes" or "no" and auto check the radio button that corresponds:
<?php include 'file.php';
$query = "SELECT * FROM TABLE";
$runquery = odbc_exec($connect,$query);
$status= odbc_result($runquery,"status");
odbc_close($file);
?>
<form>
<div class="formContainer">
<fieldset>
<legend>Campus Alert<span class="tooltip">Turn campus alert on and off.</span></legend>
<?php echo $status; ?>
Yes <input type="radio" name="alertStatus" id="alertStatus" value="yes" <?php if($status== "yes") echo "checked";?>>
No <input type="radio" name="alertStatus" id="alertStatus" value="no" <?php if($status== "no") echo "checked";?>>
</fieldset>
</div>
the <?php echo $status; ?>
is for debugging so I can make sure what the database says and the form's reaction is correct. It prints "yes" (no quotes). However, the if statement will not respond. Any idea why it's doing this?