asp for 循环 查询数据库 死循环
<%kssj=ToUnixTime(Date,Y-m-d)jssj=ToUnixTime(Date,Y-m-d)+86400response.writekssj&"<br...
<%
kssj = ToUnixTime(Date, Y-m-d)
jssj = ToUnixTime(Date, Y-m-d)+86400
response.write kssj&"<br>"
response.write jssj&"<br>"
For i = 0 To 1
%>
<div id="list" class="">
<div id="block" class="">
<%
sql="SELECT * FROM pw_threads WHERE postdate BETWEEN '"&kssj&"' AND '"&jssj&"' AND digest = '1' AND ifupload = '1' LIMIT 0, 1"
set rs= Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof then
do while not rs.eof
Randomize
%>
<div id="img_block" class="">
<a href="read.asp?tid=<%= rs("tid") %>">
<span><%= rs("subject") %></span>
</a>
</div>
<%
rs.movenext
loop
else
end if
rs.close
set rs=nothing
%>
</div>
<div id="broadcast" class="">
<img src="broadcast.png" />
</div>
</div>
<%
conn.close
set conn=nothing
kssj = kssj-86400
jssj = jssj-86400
Next
%>
<!--#include file="footer.asp"-->
问题解决了,和楼下回答的不相关 展开
kssj = ToUnixTime(Date, Y-m-d)
jssj = ToUnixTime(Date, Y-m-d)+86400
response.write kssj&"<br>"
response.write jssj&"<br>"
For i = 0 To 1
%>
<div id="list" class="">
<div id="block" class="">
<%
sql="SELECT * FROM pw_threads WHERE postdate BETWEEN '"&kssj&"' AND '"&jssj&"' AND digest = '1' AND ifupload = '1' LIMIT 0, 1"
set rs= Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not rs.bof then
do while not rs.eof
Randomize
%>
<div id="img_block" class="">
<a href="read.asp?tid=<%= rs("tid") %>">
<span><%= rs("subject") %></span>
</a>
</div>
<%
rs.movenext
loop
else
end if
rs.close
set rs=nothing
%>
</div>
<div id="broadcast" class="">
<img src="broadcast.png" />
</div>
</div>
<%
conn.close
set conn=nothing
kssj = kssj-86400
jssj = jssj-86400
Next
%>
<!--#include file="footer.asp"-->
问题解决了,和楼下回答的不相关 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询