-1
How to Update a select input with information coming from the Database and still present the options for the person to choose to update?
$id=filter_input(INPUT_GET,'id',FILTER_SANITIZE_NUMBER_INT);
$result="SELECT * FROM banco WHERE id='$id' ";
$resultado = mysqli_query($conexao,$result);
$row = mysqli_fetch_assoc($resultado);
<select name="motorista" id="motorista" placeholder="MOTORISTA" autocomplete="off" >
<?php echo '<option value="'.$row_cat_post['id'].'">'.$motorista.'</option>';?>
</select><br>
This way it only brings the stored result. N presents the primary options that made the registration. Remembering that foreign key use, then what is saved is the key that relates to the secondary bank and not the product name itself.
It needs a loop
– MagicHat