Jump to content

insert multiple data with multiple form at once


FryShadow

Recommended Posts

hello i'm new here

i got some prob for developing my system.actually my system if for school,teachers can add question(objective) and publish it to student when needed.

[code]
<form name="wizard_soalan" method="post" action="ques_process.php">
              &nbsp;&nbsp;Question  :<br>
              &nbsp;&nbsp;<input type="text" name="question" size="10"><br>
              <br>
              &nbsp;&nbsp;Subject :<br>
              &nbsp;&nbsp;<select size="1" name="subjek">
                          <option value="0">-Sila pilih-</option>
                          <option value="1">Science</option>
                          <option value="2">English</option>
                         
                          </select><br>
              <br>
              &nbsp;&nbsp;Pilih tahap soalan :<br>
              &nbsp;&nbsp;<select size="1" name="tahap">
                          <option value="0">-Sila pilih</option>
                          <option value="1">UPSR</option>
                          <option value="2">PMR</option>
                          <option value="3">SPM</option>
                          </select><br>
              <br>
              &nbsp;&nbsp;<input type="submit" value="Next">
              </form>
[/code]

this form will produce a simple form to add question depends on the $question value. lets say 20 question then 20 form will produce.

the problem is how i want to save the 20 question in the database.i'm using php and mysql

thanks for helping
Link to comment
Share on other sites

It looks like your problem isn't saving 20 questions into the database.  Your problem looks like you don't know how to setup a form, catch the POSTed data, and then insert into the database.  Your question is way to generic and you have shown us a form, that looks like it has nothing to do with 20 questions.

So I'm going to ask this question:  what is the problem?
Link to comment
Share on other sites

this is the form that will get a data to produce 20 form

http://i23.photobucket.com/albums/b393/fryshadow/form1-1.jpg

and this is the result :

form1

http://i23.photobucket.com/albums/b393/fryshadow/form2.jpg

till

http://i23.photobucket.com/albums/b393/fryshadow/form3.jpg

i'm using this code to produce the 20 question

[code]
for ($i=1;$i<=$no;$i++)
              {
                echo "<br>";
                echo "<b>No soalan : $i <br>";
                echo "<b>Soalan : <br>";
                echo "<textarea name=\"$soalan\" rows=\"7\" cols=\"30\" wrap=\"on\"></textarea><br>";
                echo "<b>Jawapan :<br>";
                echo "<b>A&nbsp;&nbsp;<input type=\"text\"><br>";
                echo "<b>B&nbsp;&nbsp;<input type=\"text\"><br>";
                echo "<b>C&nbsp;&nbsp;<input type=\"text\"><br>";
                echo "<b>D&nbsp;&nbsp;<input type=\"text\"><br>";
                echo "<br>";
              }
[/code]

how i want to save all the 20 form at once ?
all the form 1 - 20 is at the same page
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.