Categorize multiple rows and columns to display the contents of a database (part of the code in the movie server)

Source: Internet
Author: User
Server | data | database | shows that all movies in the movie Database are displayed in one page by category in three columns per row.


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

<tr>

&LT;TD height= "valign=" "Top" ><font color= "#000000" > Your current Location: </font><font color= "#000000" > <a class= "Top" href= "<%=application (" url ")%>" ><%=application ("Home")%></a>-<a class= " Bianjie "href=" <%=application ("URLs")%> "><%=application (" homes ")%></a>-all films </font> </td>

</tr>

<TR>

&LT;TD valign= "Top" >

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

<%

' Show type part code

Dim rstype,sql

Sql= "Select Typeid,type from Type"

Set Rstype=server. CreateObject ("ADODB.") Recordset ")

Rstype.open sql,conn,1,1

Do as not rstype.eof

Response. Write ("<tr bordercolor= ' #39599C ' bordercolorlight= ' #000000 ' bordercolordark= ' #39599C ' bgcolor= ' #39599C ' >")

Response.Write ("<td height= ' bgcolor= ' #6699CC ' align= ' center ' ><font color= ' #FFFF00 ' size= ' 4 ' >")

Response.Write Rstype ("type") ' Movie type name

Response.Write ("</font></TD></TR>")

Response.Write ("<tr bordercolor= ' #39599C ' bordercolorlight= ' #000000 ' bordercolordark= ' #39599C ' bgcolor= ') 39599C ' > ')

Response.Write ("<td height= ' >")

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 as not rs.eof

Response.Write ("<tr>")

For a = 1 to 3

If Rs.eof then ' determines if the end of the query table is found, empty cells are displayed if at the end

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 ' > ")

' Hits the high movie yellow Show

if (hitsnum>hits) then

. Write ("<font color= ' #FFFF00 ' >")

. Write Rs ("title")

. Write ("</font>")

Else



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.