Jump to content


Photo

insert multiple data with multiple form at once


  • Please log in to reply
4 replies to this topic

#1 FryShadow

FryShadow
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 17 July 2006 - 03:07 AM

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.

<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>

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

#2 willfitch

willfitch
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts
  • LocationNew Hope, PA

Posted 17 July 2006 - 03:50 AM

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?
Zend Certified Engineer (ZEND001989)
www.willfitch.com

#3 FryShadow

FryShadow
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 17 July 2006 - 04:17 AM

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

http://i23.photobuck...dow/form1-1.jpg

and this is the result :

form1

http://i23.photobuck...hadow/form2.jpg

till

http://i23.photobuck...hadow/form3.jpg

i'm using this code to produce the 20 question

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>";
               }

how i want to save all the 20 form at once ?
all the form 1 - 20 is at the same page

#4 FryShadow

FryShadow
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 July 2006 - 06:03 AM

anyone ?

#5 shree21

shree21
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 July 2006 - 11:28 AM

Hello...
hey think u should take the form tag...
n whn u press the next button on that u can insert that values in the table..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users