上海中春路:ASP问题谁能告诉我这段代码设置的值为什么自己增加???

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/26 03:15:21
<%
function dingdan()
dim tmprs
tmprs=conn.execute("Select Count(actionid) from shop_action Where year(actiondate)=year(date()) and month(actiondate)=month(date()) and day(actiondate)=day(date())")
dingdan=tmprs(0)
set tmprs=nothing
if isnull(dingdan) then dingdan=0
end function

function todays()
dim tmprs
tmprs=conn.execute("Select Count(bookID) from shop_books Where year(adddate)=year(date()) and month(adddate)=month(date()) and day(adddate)=day(date())")
todays=tmprs(0)
set tmprs=nothing
if isnull(todays) then todays=0
end function
%>
<%
if session("over")="" then
jsqtoday=1
if application("dntime")<=cint(hour(time())) then
conn.execute("update dept set jsqtoday=jsqtoday+1")
tmprs=conn.execute("Select jsqtoday from dept")
jsqtoday=tmprs(0)
else
conn.execute("update dept set jsqtoday=1")
tmprs=conn.execute("Select jsqtoday from dept")
jsqtoday=tmprs(0)
end if
application("dntime")=cint(hour(time()))
set tmprs=nothing

conn.execute("update dept set jsq=jsq+1")
tmprs=conn.execute("Select jsq from dept")
jsq=tmprs(0)
set tmprs=nothing

session("over")=true
else
jsqtoday=1
tmprs=conn.execute("Select jsqtoday from dept")
jsqtoday=tmprs(0)

tmprs=conn.execute("Select jsq from dept")
jsq=tmprs(0)
set tmprs=nothing
end if
%>
这段代码运行上并没有问题 但我就想知道,在没人访问的时候,为什么他自己增加访问量 ?

检查这里的条件是否正确:
if application("dntime")<=cint(hour(time())) then
conn.execute("update dept set jsqtoday=jsqtoday+1")