分類多行多列顯示資料庫中的內容(電影伺服器中的部分代碼)

來源:互聯網
上載者:User
伺服器|資料|資料庫|顯示 把電影資料庫中的所有電影按類別每行三列的方式顯示在一頁中。


<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> </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



相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。