帮忙看一下这个循环哪出了问题

ruyilin 2012-05-11 05:51:44
三个分别是pcroom【机房】 lesson[课时] yding【预订】
判断有没有课,
|---------------------------------------------------——————————————————|
|机房 课时一 课时二 课时三 |
|机房一 没课 有课 没课 |
|机房二 有课 没课 没课 |
|机房三 没课 没课 没课 |
| |
|————————————————————————————————————————————



<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<table width="1000" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999966">
<tr bgcolor="#999999">
<th height="52" colspan="5" scope="col">一览表</th>
</tr>
<tr>
<th height="37" colspan="5" align="left" scope="col"> </th>
</tr>

<%

dim pcr,num
set rs=server.createobject("adodb.recordset")
sqltext="select * from pcroom "
rs.open sqltext,conn,1,1
'rs.open "select count(*) from pcroom",conn,1,1
do while not rs.eof
pcr=rs("pcroom_id")
%>
<tr>
<th height="97" align="left" scope="col">机房<%=rs("pcroom_name")%></th>
<%
set rs1=server.createobject("adodb.recordset")
rs1.open "select count(*) from lesson",conn,1,1
num=rs1(0)
dim a
for a=1 to num

%><th><%
sql="select * from yding where yding_s_si='"&a&"' and yding_s_jiaoshi='"&pcr&"' and yding_On=1"
response.write sql
set rs2=conn.execute(sql)
title=rs2(8)
if Rs2.eof or Rs2.bof then
response.write "<td align=center><a href='yuyue.asp?app=add&date="&dateadd("d",date,a-week)&"&xingqi="&b&"&keshi="&b&"'>预定"&a&"</a></td>"
else
'response.write rs("yding_name") +"sda"
response.write "<td align=center bgcolor=#FFFF00>有课"&title&"<a href='myuyue.asp?app=add&date="&dateadd("d",date,a-week)&"&xingqi="&b&"&keshi="&b&"'>【查看】</a></td>"
'response.write "<td align=center bgcolor=#FFFF00><font size=2>"&rs("yding_name")&"</font></td>"
end if

%></th>
<%
Next
rs1.close
%>
<%rs.movenext
loop%>
</tr>


</table>
</body>
</html>


...全文
71 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
quans7910 2012-05-12
  • 打赏
  • 举报
回复
问题交代不清楚啊,如果是查询结果有问题,那你检查下你的查询条件
ruyilin 2012-05-11
  • 打赏
  • 举报
回复
3楼没报错,本来库里是有这个的信息的,但是显示可以预定 这个不是我想要的效果啊!
万载馨辰 2012-05-11
  • 打赏
  • 举报
回复
报什么错啊?
ruyilin 2012-05-11
  • 打赏
  • 举报
回复
就没有人帮我看一吗
ruyilin 2012-05-11
  • 打赏
  • 举报
回复
看到的帮帮忙谢谢!

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧