主题:ASP BBS文章数问题不明请大家帮帮我
大家好
我做了一个BBS可是在计算发新文章数的同时出错误 请大家帮我看看 我再这先谢谢大家了 请看下面 这是一个提交新帖的网页
<% option explicit %>
<!--#INCLUDE FILE="uip.asp"-->
<!--#INCLUDE FILE="function.asp"-->
<head>
<title>无标题文档</title>
</head>
<body>
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="25"><div align="center">主题</div></td>
<td height="25"><label>
<input name="title" type="text" id="title">
</label></td>
</tr>
<tr>
<td width="200" height="100"><div align="center">内容</div></td>
<td height="100"><label>
<textarea name="body" cols="50" rows="5" id="body"></textarea>
</label></td>
</tr>
<tr>
<td width="200" height="25"><div align="center">发方人姓名</div></td>
<td><label>
<input name="user_name" type="text" id="user_name">
</label></td>
</tr>
<tr>
<td width="200" height="25"><div align="center">
<label>
<input type="submit" name="Submit" value="提交">
</label>
</div></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
if request("title")<>"" And request("user_name")<>""then
dim title,body,layer,parent_id,child,hits,ip,user_name,forum_id
title=request("title")
body=request("body")
user_name=request("user_name")
layer=1
parent_id=0
child=0
hits=0
ip=request.ServerVariables("REMOTE_ADDR")
dim sql,svalues
sql="insert into bbs(title,layer,parent_id,child,hits,ip,user_name,suhmit_date"
svalues= " values('" & title &"','" & layer & "','" & parent_id & "','" & child & "','" & hits & "','" & ip & "','"& user_name &"','" & Now() &"'"
if body<>""then
sql=sql&",body"
svalues=svalues&","&"'"& body & "'"
end if
sql=sql & ")"& svalues &")"
db.Execute(sql)
Sql="Update forum Set forumcount=forumcount+1 Where id = " & forum_id
db.Execute(Sql)
db.close
response.Redirect"ccui.asp"
end if
%>
</body>
</html>
当我提交时总是出现
Sql="Update forum Set forumcount=forumcount+1 Where id = " & forum_id
db.Execute(Sql)
这句中的ID 错误 但我又不知道 那错了还请大家帮帮我
谢谢大家了
我做了一个BBS可是在计算发新文章数的同时出错误 请大家帮我看看 我再这先谢谢大家了 请看下面 这是一个提交新帖的网页
<% option explicit %>
<!--#INCLUDE FILE="uip.asp"-->
<!--#INCLUDE FILE="function.asp"-->
<head>
<title>无标题文档</title>
</head>
<body>
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="25"><div align="center">主题</div></td>
<td height="25"><label>
<input name="title" type="text" id="title">
</label></td>
</tr>
<tr>
<td width="200" height="100"><div align="center">内容</div></td>
<td height="100"><label>
<textarea name="body" cols="50" rows="5" id="body"></textarea>
</label></td>
</tr>
<tr>
<td width="200" height="25"><div align="center">发方人姓名</div></td>
<td><label>
<input name="user_name" type="text" id="user_name">
</label></td>
</tr>
<tr>
<td width="200" height="25"><div align="center">
<label>
<input type="submit" name="Submit" value="提交">
</label>
</div></td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
if request("title")<>"" And request("user_name")<>""then
dim title,body,layer,parent_id,child,hits,ip,user_name,forum_id
title=request("title")
body=request("body")
user_name=request("user_name")
layer=1
parent_id=0
child=0
hits=0
ip=request.ServerVariables("REMOTE_ADDR")
dim sql,svalues
sql="insert into bbs(title,layer,parent_id,child,hits,ip,user_name,suhmit_date"
svalues= " values('" & title &"','" & layer & "','" & parent_id & "','" & child & "','" & hits & "','" & ip & "','"& user_name &"','" & Now() &"'"
if body<>""then
sql=sql&",body"
svalues=svalues&","&"'"& body & "'"
end if
sql=sql & ")"& svalues &")"
db.Execute(sql)
Sql="Update forum Set forumcount=forumcount+1 Where id = " & forum_id
db.Execute(Sql)
db.close
response.Redirect"ccui.asp"
end if
%>
</body>
</html>
当我提交时总是出现
Sql="Update forum Set forumcount=forumcount+1 Where id = " & forum_id
db.Execute(Sql)
这句中的ID 错误 但我又不知道 那错了还请大家帮帮我
谢谢大家了

您所在位置: