https://stackoverflow.com/questions/12293939/select-dropdown-default-value
https://www.tutorialspoint.com/How-can-I-set-the-default-value-for-an-HTML-select-element
https://www.vasiljevski.com/blog/php/how-to-set-the-selected-option-of-select-tag-from-the-php/



Just put selected="selected" on the option depending on your $row['status'],
<option selected="selected" value="available">Available</option>

write Available and Unavailable into an array
$theArray = array("Available","Not Available");
loop the array:
<tr><td><font face=consolas><b>Status:*</b></font></td><td><select name=st>
<?php
foreach ($theArray as $key => $value) {
    if ($value == $stat) {
        echo('<option selected="selected" value='.$value.'>'.$value.'</option>');
    } else {
        echo('<option value='.$value.'>'.$value.'</option>');
    }
}
?>
</select></td></tr>

Comments

Popular posts from this blog

Create a RESTful API using PHP, My-sql and Slim-Framework

DeltaPi softwares

How to prevent form resubmission when page is refreshed (F5 / CTRL+R)