I am new to PHP and MySQL, please I would appreciate your help. I have a table that generates several rows depending on the number of options selected by a user. I want to store the content in a database table after the user presses the submit button. Since i cannot tell how may options the user would select and how many rows will be generated, i don't know how to write the SQL code that will store it in my database table.
here is the code to generate the table
for($x=0;$x<$N; $x++) {
echo nl2br("<td><textarea name=art[] rows=10 cols=30></textarea></td><td><textarea name=science[] rows=10 cols=30></textarea></td></textarea></td><td><textarea name=method[] rows=10 cols=30></textarea></td><td><textarea name=criteria[] rows=10 cols=30></textarea></td></tr>");
}
To get the data from the table
for($i = 0; $i <$N; $i++){
$data[] = array(($art[$i]), ($science[$i]), ($method[$i]), ($criteria[$i]));
}