I have a select that I charge with the countries, and from mySQL I recover a value. First charge all the select, but then how do I make the select show me the selected country that comes from the bd? It is understood that in the BD store the "paiscod"
<select id="pais" class="ui fluid search dropdown" name="pais">
<option value="0"></option>
<?php
$query = $mysqli -> query ("SELECT paiscod, paisnom FROM paises ORDER BY paisnom");
while ($valores = mysqli_fetch_array($query)) {
?>
<option value = "<?php echo $valores['paiscod']?>"><?php echo ($valores['paisnom'])?></option>
<?php
}
?>
</select>
Thus I charge the select