• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

分类多行多列显示数据库中的内容(电影服务器中的部分代码)

发布: 2007-6-30 18:56 | 作者: admin | 来源: | 查看: 23次 | 进入软件测试论坛讨论

领测软件测试网 把电影数据库中的所有电影按类别每行三列的方式显示在一页中。


<TABLE border="0" cellpadding="0" cellspacing="0" bordercolor="#39599C" bordercolorlight="#000000" bordercolordark="#39599C" width="573" height="429" bgcolor="#39599C">

<tr>

<td height="19" valign="top"><font color="#000000">您现在的位置:</font><font color="#000000"><a class="top" href="<%=application("url")%>"><%=application("home")%></a>-<a class="bianjie" href="<%=application("urls")%>"><%=application("homes")%></a>-全部影片 </font></td>

</tr>

<TR>

<TD valign="top">

<table width="100%" border="0" cellpadding="0" cellspacing="0">

<%

@#显示类型部分代码

dim rstype,sql

sql="select typeid,type from type"

set rstype=server.CreateObject("ADODB.Recordset")

rstype.open sql,conn,1,1

do while not rstype.eof

response.Write("<TR bordercolor=@##39599C@# bordercolorlight=@##000000@# bordercolordark=@##39599C@# bgcolor=@##39599C@#>")

response.write(" <TD height=@#19@# bgcolor=@##6699CC@# align=@#center@#><font color=@##FFFF00@# size=@#4@#>" )

response.write rstype("type") @#电影类型名称

response.write(" </font></TD></TR> ")

response.write(" <TR bordercolor=@##39599C@# bordercolorlight=@##000000@# bordercolordark=@##39599C@# bgcolor=@##39599C@#> ")

response.write(" <TD height=@#19@#> ")

response.write(" <table width=@#100%@# border=@#1@# cellpadding=@#0@# cellspacing=@#0@# bordercolor=@##39599C@# bordercolorlight=@##000000@# bordercolordark=@##39599C@#> ")

dim rs,strSQL

strSQL =" SELECT * FROM film where typeid= " &rstype("typeid")&" order by dateandtime desc"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.open strSQL,Conn,1,1

countrs=rs.recordcount

all=1

do while not rs.eof

response.write(" <tr> ")

for a = 1 to 3

if rs.eof then @#判断是否到了查询表结尾,如果到了结尾,则显示空单元格

response.write(" <td><font color=red>&nbsp;</font></td> ")

else

daynum=date() -rs("dateandtime")

hitsnum=rs("hits")

with response

.write(" <td width=@#33%@#><a href=# onClick=""javascript:window.open(@#list.asp?id= ")

.write rs("id")

.write ("@#,@#list@#,@#toolbar=no,resizable=no,scrollbars=yes,width=480,height=331@#)""> ")

.write (" </a><a href=# onClick=""javascript:window.open(@#list.asp?id= ")

.write rs("id")

.write (" @#,@#list@#,@#toolbar=no,resizable=no,scrollbars=yes,width=480,height=331@#)""><font color=@##000000@#> ")

@#点击率高的电影黄色显示

if (hitsnum>hits) then

.write (" <font color=@##FFFF00@#> ")

.write rs("title")

.write (" </font> ")

else

.write rs("title")

end if

.write (" </font></a> ")

.write (" </td> ")

end with

rs.movenext

all=all+1

end if

next

response.write (" </tr> ")

loop

response.write (" </table> ")

rs.close

response.write (" </tr> ")

rstype.movenext

loop

rstype.close

%>

</table>


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网