I am trying to remove as much code from within my html as possible without using a template framework and I am unsure why 'selected'
is not being returned to define 'selected'
for the options of a select box. $row_status
populates the options ok and $status
has a value assigned.
Am I way off on this?
<select id='status'>
<option>Please Select</option>
<?php while($row_status = mysqli_fetch_assoc($results_status)): ?>
<option <?php sel($row_status['list_value'],$status)?> > <?php echo $row_status['list_value'] ?> </option>
<?php endwhile; ?>
</select>
function sel($rs, $status){
if ($rs==$status){
return "selected";
}
}