Lets say $cat
is 5, I want it to have the forum with ID 5 selected but it wont. I have a forum with ID 5. Shouldn't this work?
<select name="category" id="category">
foreach($db->query("SELECT name FROM forums ORDER BY disp_position ASC") as $row) {
if ($cat == $row['id']) {
echo '<option value="'.$row['id'].'" selected>'.$row['name'].'</option>';
} else {
echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
}
</select>