Hello again mates,
I am trying to update status of a selected record on the deeds table.
Once the record is successfully updated, we would like the most recently updated record to become the default selected record on the Status dropdown.
I would like to think that this is fairly routine and straightforward.
However, it doesn't appear to be working for me no matter what I try.
After each record is successfully updated, the last updated record is still not the selected value.
Where am I going wrong here?
<select name="sStatus" data-placeholder="Select status..." class="chosen-select" style="width:178px;">
$tsql = "SELECT DISTINCT s.StatusID, s.Status FROM status s inner join deeds d on s.StatusID = d.StatusID";
$stmt = sqlsrv_query( $conn, $tsql);
while($row = sqlsrv_fetch_array($stmt,SQLSRV_FETCH_ASSOC))
if($strDefault == $sStatus)
$sel = "selected";
$sel = "";
<option value="<?php echo strDefault;?>" <?php echo $sel;?>><?php echo $row["Status"];?></option>