0 Replies Latest reply on Jul 9, 2014 1:40 PM by c3f239ab-b161-4101-ad3d-ed97f6e7461f

    How to send id of multiple rows to update page in one form action?

    c3f239ab-b161-4101-ad3d-ed97f6e7461f

                              <%

      try {

         

                  int sn=0;

                  String title=null;

                   String date=null;

                    String month=null;

                     String year=null;

                      String time=null;

                      String venue=null;

                       String about=null;

                  Class.forName("com.mysql.jdbc.Driver").newInstance();

                       Connection cn = DriverManager.getConnection("jdbc:mysql://localhost/spsti","root","");

          Statement st=cn.createStatement();

                                 ResultSet rs= st.executeQuery("Select * from eventrecord");

                                 //ResultSet rs= st.executeQuery("Select * from devpost where emailid='"+emailid+"'");

                                 while(rs.next()){

                                     title=rs.getString("title");

                                    sn=rs.getInt("sn");

                                    date=rs.getString("date");

                                    venue=rs.getString("venue");

                                    month=rs.getString("month");

                                    year=rs.getString("year");

                                    about=rs.getString("about");

                                    time=rs.getString("time");

                                   // out.println();

        

        %>

        <tbody>

        <tr>

                                                

                                          <form action="updateevent.jsp?sn=<%=rs.getString("sn")%>" method="post">

                                                          <td style="text-align: center;"><input type="text" name="sn" value="<%=rs.getInt(1)%>"/></td>

                                                          <td><textarea class="post" rows="15" name="title" textareaObject.value="text" ><%=rs.getString(2)%></textarea></td>

                                                          <td><textarea class="post" rows="8" name="date" textareaObject.value="text" ><%=rs.getString(3)%></textarea></td>

                                                              <td><textarea class="post" rows="15" name="month" textareaObject.value="text" ><%=rs.getString(4)%></textarea></td>

                                                             <td><textarea class="post" rows="8" name="year" textareaObject.value="text"  ><%=rs.getString(5)%></textarea></td>

                                                              <td><textarea class="post" rows="8" name="time" textareaObject.value="text" ><%=rs.getString(6)%></textarea></td>

        <td><textarea class="post" rows="15" name="venue" textareaObject.value="text" ><%=rs.getString(7)%></textarea></td>

        <td><textarea class="post" rows="15" name="about" textareaObject.value="text" ><%=rs.getString(8)%></textarea></td>

                                                      

                                                              <td> <button type="submit" class="blue"   >Update</button></td>

                                            

        </tr>

        </tbody>

                                              <%

                                              }

                                              %>

                                                 <%

         }

         catch(ClassNotFoundException ec)

                {

                  out.println("driver not found");

                }

                 catch(SQLException et)

                  {

                   out.println(et.getMessage());

                    

                                   }

        %>

        </table>

                                       </form>