hits.asp统计数量出错..帮下忙!

来源:百度知道 编辑:UC知道 时间:2024/06/23 04:56:54
<!--#include file="inc/conn.ASP"--> <%
set rs=server.createobject("adodb.recordset")
sql="select * from comics where ID="&request("id")&""
rs.open sql,conn,1,3
rs("hits")=rs("hits")+1
rs.update
if month(date())=month(rs("hits_m_date")) then
rs("hits_m")=rs("hits_m")+1
rs.update
else
rs("hits_m")=1
rs("hits_m_date")=now()
rs.update
end if
if DatePart("ww", now())=rs("hits_w_date") then
rs("hits_w")=rs("hits_w")+1
rs.update
else
rs("hits_w")=1
rs("hits_w_date")=DatePart("ww", now())
rs.update
end if
rs.close
conn=close
set conn=nothing%>
Microsoft OLE DB Provider for ODBC Dri

<!--#include file="inc/conn.ASP"--> <%
if request("id") <>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from comics where ID="&request("id")&""
rs.open sql,conn,1,3
rs("hits")=rs("hits")+1
rs.update
if month(date())=month(rs("hits_m_date")) then
rs("hits_m")=rs("hits_m")+1
rs.update
else
rs("hits_m")=1
rs("hits_m_date")=now()
rs.update
end if
if DatePart("ww", now())=rs("hits_w_date") then
rs("hits_w")=rs("hits_w")+1
rs.update
else
rs("hits_w")=1
rs("hits_w_date")=DatePart("ww", now())
rs.update
end if
rs.close
end if
conn=close
set conn=nothing%>

你把第3行换成这个试试:

sql="