Hello ppl. I am new to this site and in dire need of help
I have this coding where the user inputs the number of records he is to input and another page will load with that number or data rows.
But when i do a sql statement to save the data it says that there's syntax error in the INSERT INTO statement whereas i don't think that there is any.
Here's the code
<%
Connection con = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:Prod2","","");
java.sql.Statement stm = con.createStatement();
String num = (String)session.getValue("num");
int newNum = Integer.parseInt(num);
for (int i=0; i<=newNum; i++)
{
String todate = request.getParameter("todate");
String week = request.getParameter("week");
String customer = request.getParameter("customer");
String model = request.getParameter("model'+i+'");
String lotNum = request.getParameter("lotNum'+i+'");
String lquan = request.getParameter("lquan'+i+'");
String insp = request.getParameter("insp'+i+'");
String rej = request.getParameter("rej'+i+'");
String area = request.getParameter("area'+i+'");
String loc = request.getParameter("loc'+i+'");
String sql = "INSERT INTO OQA(Date,Week,Customer,Model,Lot_No,Lot_Qty,Inspected_By,Reject_Desc,Area_Concerned,Location) VALUES ('"
+todate+"','"+week+"','"+customer+"','"+model+"','"+lotNum+"','"+lquan+"','"+insp+"','"+rej+"','"+area+"','"+loc+"')";
stm.executeUpdate(sql);
}
stm.close();
con.close();
%>
Can anyone help me..please
Regards,
Ctzen