I'm following a php video lesson with mysql and I'm able to list the data of a table in a list (list), just so that they know that the connection problem with the bank is already over. I tried to use the same code to list the same table in a combobox, and it is not populating. The combo appears, but does not fill in the data. Does anyone know where I'm going wrong? Here is the code:
<body>
<ul>
<?php
// Passo 4 - Listagem dos dados
while($registro = mysqli_fetch_assoc($categorias)){
?>
<li><?php echo $registro ["nomecategoria"]?></li>
<?php
}
?>
</ul>
<form name="produto" method="post" action="">
<label for="">Selecione um produto</label>
<select>
<option>Selecione...</option>
<?php
while($registro = mysqli_fetch_assoc($categorias)) { ?>
<option = "<?php echo $registro['categoriaID'] ?>"><?php echo $registro["nomecategoria"] ?></option>
<?php } ?>
</select>
</form>
<?php
//Passo 5 - Liberar dados da memória
mysqli_free_result($categorias);
?>
</body>