1
I have a database and I want to retrieve its contents and present it within <select>
's, the initial I get, I have 7 names in the database and I can present them all in the same select box, what I want now is to have 7 select’s each with the 7 names, would serve to choose in the future the order of arrival, I do not know if I made me understand, the code I have now is this:
<select name='listagem_dia'>
<?php
while ($dados = mysql_fetch_array($resultado)) {
$nome = $dados["nome"];
$id= $dados["id"];
echo "<ul><li><option value=".$id.">".$nome."</option></li></ul>";
}
?>
</select>
It works well only I can not duplicate the boxes depending on the number of results I have... I have already got the 7 boxes but only one name appears in each of them... someone knows how to duplicate the boxes on top depending on the number of results obtained?
@Rafael You will have to repeat everything 7 times, inside the
while
will not give.– user7261
@Andrey, but it was supposed to be all automatic, he repeats according to the number of results obtained that will not be constant... I’ve tried with while but it’s not working...
– Rafael