科迈罗6.2v8价格:字段 'news.title' 不能是零长度的字符串

来源:百度文库 编辑:神马品牌网 时间:2024/05/07 12:52:25
<body bgcolor="#6699dd">
<h2 align="center">添加新闻信息</h2>
<table width="100%" border="0">
<tr>
<td><form action="insert.asp" method="post" enctype="multipart/form-data">
<table width="600" border="0" align="center" cellspacing="1" bgcolor="#333333">
<tr bgcolor="#6699DD">
<td><div align="center">新闻标题:</div></td>
<td><input type="text" size="60" name="title"></td>
</tr>
<tr bgcolor="#6699DD">
<td><div align="center">新闻内容:</div></td>
<td><textarea rows="5" cols="60" name="comment"></textarea></td>
</tr>
<tr bgcolor="#6699DD">
<td><div align="center">新闻类别:</div></td>
<td><select name="n_class" id="n_class">
<option>农业</option>
<option>教育</option>
<option>环境</option>
<option>慈善</option>
<option>公益</option>
<option>法规</option>
</select></td>
</tr>
<tr bgcolor="#6699DD">
<td colspan="2"> </td>
</tr>
<tr bgcolor="#6699DD">
<td colspan="2"><div align="center">
<input name="submit" type="submit" value="提交">

<input name="reset" type="reset" value="重填">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
</bdoy>
</html>

<!--#include file=conn.asp-->
<html>
<head><title></title>
<%
dim title,n_class,comment,n_date
title=request("title")
n_class=request("n_clss")
comment=request("comment")
n_date=now()

sql="insert into news(title,n_class,comment,n_date)values('"&title&"','"&n_class&"','"&comment&"','"&n_date&"')"
conn.execute(sql)

conn.close
set conn=nothing
%>

</head>

找到的答字都是把字段改成允许空,但是如果是空的话可就全空了,数据库里根本没有数据.

大师指导,高手请留下QQ MSN POPO EMAIL 谢谢

把form的enctype="multipart/form-data"去掉

“经验不足”,如果在服务器输出一下title等变量的值就会发现服务器端并没有收到数据
网上资料很多,查查看