0
Hello. I’m having trouble submitting data from a form. My problem is this:
My client created a series of products in the database. And now he needs a form where all the quantities of the products created will appear. In this form it will update the amount of products available.
There is no limit to the creation of products. So it may be that tomorrow the form has more or less fields to be filled.
I managed to generate the form as follows:
<?php
$produtos = array();
$sql = "select * from tb_produto";
$search_query = mysql_query($sql);
while($select = mysql_fetch_array($search_query)){
$id_produto = $select["id_produto"];
$titulo = $select["titulo"];
$quantidade = $select["quantidade"];
array_push($produtos, $titulo);
?>
<div>
<label><?php echo $titulo; ?></label>
<input type="text" name="txtQuantidade" value="<?php echo $quantidade; ?>">
</div>
<?php
}
?>
Now I need to submit this data. My question is: how is it possible to submit a form formed by an unknown number of fields at once?
Thank you! You helped me a lot!!! Unfortunately I didn’t have time to test the solution until today. But I just implemented something based on what you suggested and worked perfectly. Thanks!!!
– SpammingOff