0
I have a select that takes the data from the database to make an insertion:
<div class="row">
<div class="form-group col-md-2">
<label for="marca">Marca</label>
<?php
$link = open_database();
$query = "SELECT marca_id, marca_nome FROM marca";
$queryidmarca = mysqli_query($link, $query); ?>
<select class='form-control' id='marca' name="veiculo['marca_id']">
<option value="">-Selecione-</option>
<?PHP while ($tipo = mysqli_fetch_array($queryidmarca)){ ?>
<option value="<?PHP echo $tipo['marca_id'] ?>"><?PHP echo $tipo['marca_nome'] ?></option>
<?PHP } ?>
</select>
</div>
</div>
I wanted to know how to leave selected the information that was saved in this select in another select that is in another form.
Thank you, you solved the problem.
– w.rock