F
flyso
Unregistered / Unconfirmed
GUEST, unregistred user!
<table width="422" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="basic">
<%
dim row_count,rows,list()
rows=5
row_count=1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select DISTINCT [Hbey_medtreat_hp.doctor].worksmallksname from [Hbey_medtreat_hp.ksclass],[Hbey_medtreat_hp.doctor] where [Hbey_medtreat_hp.ksclass].classname=[Hbey_medtreat_hp.doctor].worksmallksname and [Hbey_medtreat_hp.doctor].userid='"&userid&"'",conn,1,1
if not (rs1.eof and rs1.bof) then
do while not rs1.eof
%>
<tr bgcolor="#F4F4F4">
<% classname=rs1("worksmallksname") %>
<td width="102" align="center" bgcolor="#999999" ><span class="style9"><%=classname%></span></td>
<%
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from [Hbey_medtreat_hp.doctor] where worksmallksname='"&classname&"'",conn,1,1
do while not rs2.eof
%>
<td width="91" align="center" style="BACKGROUND: #f4F4F4" onmouseover="this.style.background='#FFFFFF'" onmouseout="this.style.background='#F4F4F4'"> <%=trim(rs2("doctorname"))%> </td>
<%if row_count mod rows=0 then
%>
</tr> <%end if
rs2.movenext
row_count=row_count+1
loop
%>
<%
rs1.movenext
loop
else
response.write "暂无信息!"
end if
rs1.close
set rs1=nothing
%>
</table>
程序没问题,但显示有问题,本来是每行显示5个记录,但他显示错乱,有些共7条记录的显示成三行,第一行1个第二行5个第三行1个,本来只需要二行,第一行5个,第二行2个的,请问是何原因?
<%
dim row_count,rows,list()
rows=5
row_count=1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select DISTINCT [Hbey_medtreat_hp.doctor].worksmallksname from [Hbey_medtreat_hp.ksclass],[Hbey_medtreat_hp.doctor] where [Hbey_medtreat_hp.ksclass].classname=[Hbey_medtreat_hp.doctor].worksmallksname and [Hbey_medtreat_hp.doctor].userid='"&userid&"'",conn,1,1
if not (rs1.eof and rs1.bof) then
do while not rs1.eof
%>
<tr bgcolor="#F4F4F4">
<% classname=rs1("worksmallksname") %>
<td width="102" align="center" bgcolor="#999999" ><span class="style9"><%=classname%></span></td>
<%
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from [Hbey_medtreat_hp.doctor] where worksmallksname='"&classname&"'",conn,1,1
do while not rs2.eof
%>
<td width="91" align="center" style="BACKGROUND: #f4F4F4" onmouseover="this.style.background='#FFFFFF'" onmouseout="this.style.background='#F4F4F4'"> <%=trim(rs2("doctorname"))%> </td>
<%if row_count mod rows=0 then
%>
</tr> <%end if
rs2.movenext
row_count=row_count+1
loop
%>
<%
rs1.movenext
loop
else
response.write "暂无信息!"
end if
rs1.close
set rs1=nothing
%>
</table>
程序没问题,但显示有问题,本来是每行显示5个记录,但他显示错乱,有些共7条记录的显示成三行,第一行1个第二行5个第三行1个,本来只需要二行,第一行5个,第二行2个的,请问是何原因?