问题描述
- Unknown column 'XZMC' in 'field list'报错如何解决
-
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">数据库连接
<%
String ksh=request.getParameter("ksh");
String XM = request.getParameter("XM");
String XB= request.getParameter("XB");
String zongfen= request.getParameter("zongfen");
String luquzhuanye= request.getParameter("luquzhuanye");
String jiguang_h= request.getParameter("jiguang_h");
String jiguang=request.getParameter("jiguang");
String kelei_h = request.getParameter("kelei_h");
String kelei= request.getParameter("kelei");
String CSRQ= request.getParameter("CSRQ");
String ZX_H= request.getParameter("ZX_H");
String ZXMC= request.getParameter("ZXMC");
String leibie_h=request.getParameter("leibie_h");
String leibie = request.getParameter("leibie");
String XZMC= request.getParameter("XZMC");
String ZMMC= request.getParameter("ZMMC");
String sql="insert into stu_info(ksh,XM,XB,zongfen,luquzhuanye,jiguang_h,jiguang,kelei_h,kelei,CSRQ,ZX_H,ZXMC,leibie_h,leibie,XZMC,ZMMC) values ('"+ksh+"','"+XM+"','"+XB+"','"+zongfen+"','"+luquzhuanye+"','"+jiguang_h+"','"+jiguang+"','"+kelei_h+"','"+kelei+"','"+CSRQ+"','"+ZX_H+"','"+ZXMC+"','"+leibie_h+"','"+leibie+"','"+XZMC+"','"+ZMMC+"');";db.executeSql(sql);
db.Release();
out.println(sql);
%>
解决方案
列名没有找到,仔细检查下你的数据库的表结构。
解决方案二:
stu_info表里面没有XZMC
查查是不是写错了,或者是其他表里的字段
解决方案三:
错误不是提示表中没该字段吗
解决方案四:
错误信息没有该字段,去表看下有没有字段XZMC