I'm working on a project where the user will get an online form they have to fill out with items. I have many different labels for personal data and one label for the item name, that they will have to select from a dropdown (items come from the database).
<label id="first">Item name</label><br/>
<select name="itemname" required>
<?php
$sql = mysqli_query($con, "SELECT name FROM items");
while ($row = $sql->fetch_assoc()){
$naziv = $row['name'];
echo '<option value="'.$naziv .'">'.$naziv .'</option>';
}
?>
</select><br/>
Now this code is working perfectly, and I also have a quantity field for it. Now, I don't have a clue how I could add the option to add multiple input fields without having to declare many more database columns and separate inputs for each one. Could I somehow do this dinamically?