I need to pass the value that I receive from a get to a Select and that the value I receive is selected. So far I've done that, but I only get the option selected by the GET, it does not show me the rest of the options. I show my code in case you see I'm doing wrong.
<select class="ui fluid dropdown" id="tipo" name="tipo">
<?php
$result_1 = $mysqli->query("SELECT * FROM tipos WHERE id =" . $_GET['necesito']);
while ($row_1 = $result_1->fetch_array()) {
if ($row_1['tipo'] == $tipo) {
echo "<option value='" . $row_1['id'] . "' selected>" . $row_1['tipo'] . "</option>";
} else {
echo "<option value='" . $row_1['id'] . "'>" . $row_1['tipo'] . "</option>";
}
}
?>
</select>