0
I’ve researched this before and I could never get a code that works. When I put the code on, nothing gets a single option.
I wanted a code that could see the data in a select
Code that I’m using:
Serviço: <br>
<select name='servico' id='servico'>
<option>Selecionar Serviço</option>
<?php
$sql_p= "SELECT nome_prod FROM produtos";
$query=mysqli_query($ligacao,$sql_p);
$rows=array();
while($row=mysqli_fetch_assoc($query)){
$rows[]=$row;
echo "<option value=".$rows['nome_prod'].">".$rows['nome_prod']."
</option>";
}?>
</select>
Have you tried using the mysqli_fetch_array ?
– LeAndrade
I haven’t used the
mysqli_fetch_array
– Bruno Teixeira
mine is like the bottom one now, but there’s nothing in it
– Bruno Teixeira
the
mysqli_fetch_array
is not the same thing as themysqli_fetch_assoc
?– Bruno Teixeira
The difference between the two is basically in the indexing of the array.
– LeAndrade