代码是:
<%
sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("title")=Request("title")
rs("style")=Request("type")
rs("content") = request("content")
rs("time")=now()
rs("name")=request.Session("admin_id")
rs.update
rs.close
%>
不知道怎么改,请高手指点
2 个解决方案
#1
你可以试试这样,不过不太安全
------------------------------------------------------
dim strsql
strsql="UPDATE news([title],[type],[content],[time],[name]) values(" _
+ Request("title") + "," + Request("type") + "," + request("content") + "," _
+ now() + "," + request.Session("admin_id") + ")"
conn.execute strsql
------------------------------------------------------
dim strsql
strsql="UPDATE news([title],[type],[content],[time],[name]) values(" _
+ Request("title") + "," + Request("type") + "," + request("content") + "," _
+ now() + "," + request.Session("admin_id") + ")"
conn.execute strsql
#2
1。你检查你输入的数据类型和数据库的匹不匹配
2。你检查更新的数据字段中有没有自增的字段
2。你检查更新的数据字段中有没有自增的字段
#1
你可以试试这样,不过不太安全
------------------------------------------------------
dim strsql
strsql="UPDATE news([title],[type],[content],[time],[name]) values(" _
+ Request("title") + "," + Request("type") + "," + request("content") + "," _
+ now() + "," + request.Session("admin_id") + ")"
conn.execute strsql
------------------------------------------------------
dim strsql
strsql="UPDATE news([title],[type],[content],[time],[name]) values(" _
+ Request("title") + "," + Request("type") + "," + request("content") + "," _
+ now() + "," + request.Session("admin_id") + ")"
conn.execute strsql
#2
1。你检查你输入的数据类型和数据库的匹不匹配
2。你检查更新的数据字段中有没有自增的字段
2。你检查更新的数据字段中有没有自增的字段