I have a form that a user can add multiple textareas to build the form before submitting to the mysql database.
I need to add a new row to the questions_table for every question. This is key: 1 form fires multiple insert queries. One for every question textarea.
Here is a minimal example of one table row:
There are other hidden fields in the in the form not listed below like id, user, ordering, ect... But I can only have one question column per row.
I would like to use the form submit button to loop thru each question textarea and insert one question per row. What is the best way to go about doing this?
<form action="index.php?event=submit" id="form1">
<textarea rows="4" cols="30" name="question" form="form1">Enter text</textarea>
<textarea rows="4" cols="30" name="question" form="form1">Enter text</textarea>
<textarea rows="4" cols="30" name="question" form="form1">Enter text</textarea>
<textarea rows="4" cols="30" name="question" form="form1">Enter text</textarea>
<input type="submit">
</form>