为什么sql的语句不执行??????
String action=Req.getPara(request, "action ");
String [] result = request.getParameterValues( "test ");
String sql= " ";
int errcode;
int j=0;
if(action.equals( "update ")){
int count=Integer.parseInt(Req.getPara(request, "count "));
String idList= " ";
//System.out.print( "12313316554 ");
for(int i=0;i <result.length;i++){
j=Integer.parseInt(result[i]);
sql= "update tbtool_ques_option set clicks=clicks+1 where id= 'j ' ";
errcode=dao.conExec(sql);
[解决办法]
sql= "update tbtool_ques_option set clicks=clicks+1 where id= 'j ' ";
这一行是不是你的原程序?
如果是,那显然是不对。
1)如果id是字符型,应该为sql= "update tbtool_ques_option set clicks=clicks+1 where id= ' "+j+ " ' ";
2)如果id是数字型,应该为sql= "update tbtool_ques_option set clicks=clicks+1 where id= "+j;