Advertisement
nakhaleeda

updatebooking.jsp

Sep 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  2. pageEncoding="ISO-8859-1"%>
  3. <%@page import="java.sql.*,java.util.*"%>
  4. <%
  5.  
  6.  
  7.  
  8.  
  9. // get the ID
  10. String idSaya = request.getParameter("userid");
  11. int id = Integer.parseInt(idSaya);
  12.  
  13. //retrieve all information
  14. String a = request.getParameter("name");
  15. String b = request.getParameter("email");
  16. String c = request.getParameter("phone");
  17. String d = request.getParameter("message");
  18.  
  19.  
  20. // sql query to retrieve values from the specified table.
  21. String query = "UPDATE feedback SET name='"+a+"'"
  22. + ",email='"+b+"',phone='"+c+"',message='"+d+"',WHERE id='"+id+"'";
  23.  
  24.  
  25. conn.commit();
  26. out.println("Data is successfully inserted!");
  27. }
  28. catch(Exception g)
  29. {
  30. System.out.print(g);
  31. g.printStackTrace();
  32.  
  33. }
  34.  
  35. response.sendRedirect("feedbacklist.jsp");
  36. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement