shamuraq Posted June 4, 2009 Share Posted June 4, 2009 Hi Guys, Usually my form table would have one element of each kind. eg; <form id="form1" name="form1" method="post" action="s_addCheckList.php"> <tr> <td width="20%" valign="top" class="italic01">01</td> <td width="88%" class="text02">[b]<textarea name="qn" cols="50" class="Question01" id="qn">1 + 1 + 1 =</textarea>[/b] <table width="36%" border="0" cellpadding="0" cellspacing="3"> <tr> <td>[b]<input name="choice1" type="text" id="choice1" value="A) 3 groups of 1" size="15" />[/b]</td> <td>[b]<input name="choice2" type="text" id="choice2" value="B) 4" size="15" />[/b]</td> </tr> <tr> <td>[b]<input name="choice3" type="text" id="choice3" value="C) -2" size="15" />[/b]</td> <td>[b]<input name="choice4" type="text" id="choice4" value="D) 3" size="15" />[/b]</td> </tr> </table></td> <td><table width="100%" border="0" cellpadding="0" cellspacing="3"> <tr> <td class="text02">Answer</td> </tr> <tr> <td><[b]input name="answer" type="text" id="textfield2" value="A) 3 groups of 1" size="5" />[/b]</td> </tr> </table></td> </tr> </form> So if you can see i have element 'qn','choice1','choice2','choice3','choice4' and 'answer' to be inserted into the database under their invidual columns eg; `Question`,`choice1`, `choice2`,`choice3`,`choice4` and `answer`. How do i insert into the database if : 1) I have more than one 'qn','choice1','choice2','choice3','choice4' and 'answer' to be inserted into their individual column. 2) Is there a script to compile more than one 'qn','choice1','choice2','choice3','choice4' and 'answer' as an array and submit them into their invidual columns in the database? Thanx in advance guys... Quote Link to comment Share on other sites More sharing options...
fenway Posted June 7, 2009 Share Posted June 7, 2009 One answer = one row. Multiple answers = multiple rows. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.