I have a form… which is automatically generated from a mysql select query.
Some forms only have 5 insert boxes, some have 8.
What would be the best way to count how many things have been posted for the form and insert them?
I need to insert a new row for each form field submitted for this… and I need a way to know how many fields have been posted and insert that many rows accordingly with the correct values.
You name your fields as choice
<input name=“choice”>
This will give you an array of “choices” in the $_POST. Use var_dump to see the results. Then you can just foreach($_POST[‘choices’] as $choice) and it doesn’t matter how many.