Doesn't this need to = 1 or something??
[PHP]if($row['isDefault']);[/PHP]
Hi,
If the data type is tinyint this is behaves in a way that is the same as logical type. However, it won't hurt set to '=1' if you prefer.
Also why are you telling it to display the word selected='selec ted'???
[PHP] echo " selected='selec ted' " ;[/PHP]
What this does, and here is where the problem lies, is is says that the selected property of the option within the select input type is set to be selected - that's the syntax. In the code snippet I supplied before there is a bit of a copy and past error:
[php]
$sql = "SELECT * FROM `hesk_involved` ORDER BY `name` ASC";
$result = hesk_dbQuery($s ql);
echo "<select name='testSelec t'>"; //name is up to you
while ($row=hesk_dbFe tchAssoc($resul t))
{
echo "<option value=\"$row[name]\">$row[name]";
if($row['isDefault']);
{
echo "selected='sele cted'";
}
echo ">" . $row['description']. "</option>"; // NOTE: $description is a column in the table that holds what will appear in the drop down list for the user.
echo "</option>";
}
[/php]
If you remove
>$row[name] then I think all should be well as the code will then set the property within the element tag. That's my fault for some sloppy copy and paste work.
This should now work for you.
Cheers
nathj