Answer the question
In order to leave comments, you need to log in
How to make a select form from the rows received from the database?
There is such code
$sql = $db->query("SELECT `str_code` FROM $db_str WHERE str_area='forma'");
while($item = $sql->fetch()){
$res = $item['str_code'];
}
you need to place the received lines from the database for input into the form as a select
< form method="post"> //the form itself
< select name="polling"> //drop-down menu that is clogged with an array
//filling the drop-down list
< /select>
< input type="submit" value="Ok" />
Answer the question
In order to leave comments, you need to log in
< select name="polling"> //выпадающее меню, которое забивается массивом
<?php while($item = $sql->fetch()):?>
<option><?=$item['str_code'];?></option>
<?php endwhile;?>
< /select>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question