Hey All,
Im just trying to cut down on thousands of lines of code at the moment and hopefully someone could help me.
I have a drop down box and the "selected" value needs to be selected by a dynamic value that gets entered into the database, this is currently how im doing it:
<?php
if($modify_row[21] == "0") {
print "<option value=\" \"></option>\n";
print "<option value=\"1\">Active</option>\n";
print "<option value=\"0\" selected>In-Active</option>\n";
} elseif ($modify_row[21] == "1") {
print "<option value=\" \"></option>\n";
print "<option value=\"1\" selected>Active</option>\n";
print "<option value=\"0\">In-Active</option>\n";
}
?>
At the moment i have over 100 "options" and i think it would be a major waist of code doing it this way, can someone help me out please.
Its fairly straight forward, basically the option that is automatically selected needs to be the one coming from the database $modify_row[21].
Thanks All