good afternoon, I would appreciate your help, I will explain my problem: I am making an option to edit requests which are shown in a table, so when the edit button is clicked, it redirects me to an html that receives the data of that request and fills them in the form to be able to edit, my problem is when filling out a select, you must select the option that the request has saved, I would appreciate your help, what I currently do is create another option with the data received but this data is created repeated in the select:
<div class="form-group">
<label class="control-label col-sm-4" for="Venta">Credito Aprobado:</label>
<div class="col-sm-8"><select class="form-control " name="credito_aprobado" required data-bv-notempty-message="Por favor seleccionar" disabled="disabled"><option value="<?php echo $data->tcc?>"><?php echo $data->tcc?></option><option value="SI">SI</option><option value="NO">NO</option></select></div>
</div>
Assuming that the value of
$data->tcc
is a "YES" or a "NO" to evaluate which option should be selected you should do the following