• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no output display in dropdown list

#2
Code:
<select name="staff" id="staff" required>
<option value="">Select Staff</option>

<?php
while($row_subject = mysql_fetch_array($query_subject))
{
    $sel = '';
    if($this->input->post('staff') == $row_subject['deo_code']) {
        $sel = 'selected';
    }
    echo '<option value="'.$row_subject['deo_code'].'" '.$sel.'>'.$row_subject['deo_code']."-".$row_subject['deo_name'].'</option>';
}
?>
</select>

1) If you dont know how to use a ? b : c use if first
2) Why you use four times <?php when you can use one?
Reply


Messages In This Thread
no output display in dropdown list - by kvanaraj - 10-11-2018, 03:35 AM
RE: no output display in dropdown list - by Piotr - 10-11-2018, 07:20 AM
RE: no output display in dropdown list - by Piotr - 10-11-2018, 10:40 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.