Hi I'm having a little trouble passing a few variablesin to a database using a java servlet, here is the code I am working with and what I have attempted so far...
String ID = request.getParameter("ID"); String name = request.getParameter("name"); String surname = request.getParameter("surname"); String degree = request.getParameter("degree"); String DOB = request.getParameter("DOB");
These are my variables which pulled form another HTML form
I want to pass these into a table 'students' which is already created.
the trouble I am having is concatenating the statement so it will work through Mysql, I am sure it is very simple but I just can't figure it out.
This is what I have tried so far
String updateSQL = "insert into students (studentno, firstname, surname, degreecode, dob) values '" + ID + "',"+"'" + name + ",'"+"'" + surname + ",'"+"'" + degree + ",'"+"'" + DOB + "'}";
Thanks in advance for any help!