我有一段代码按字母顺序从网页上的数据库ACROSS 3 列中写入数据。
例子:
a 结果 b 结果 c 结果 d 结果 e 结果 f 结果 g 结果 h 结果 i 结果
我需要按字母顺序显示它 DOWN the columns,如下所示:
结果 d 结果 g 结果 b 结果 e 结果 h 结果 c 结果 f 结果 i 结果
请记住,我有大约 100 个数据结果,它将显示第一列中的前 1/3 降序,然后开始一个新列并继续,将其分成 3 个相等的部分。
我现在对行进行排序的代码是:
<%
GL="<table width="+Z+"100%"+Z+"border=0 cellpadding=3 celspacing=3>"
sql="select * from guideDef order by guideDesc;"
rs.open sql,adoCon
colCount=0
do while not rs.eof
colCount=(colCount+1) mod 3
if colCount=1 then GL=GL+"<tr>"
GL=GL+"<td valign=middle id=menu1 width="+Z+"33%"+Z+">"+E
GL=GL+"<a href="+Z+"shop.asp?guide="+rs("guide")+"&city=Plantation"+Z+">"+E
GL=GL+rs("guideDesc")+"</a></td>"
if colCount=0 then GL=GL+"</tr>"
GL=GL+E
rs.moveNext
loop
rs.close
if colCount=1 then GL=GL+"<td> </td><td> </td></tr>"+E
if colCount=2 then GL=GL+"<td> </td></tr>"+E
GL=GL+"</table>"
response.write GL
%>
提前感谢您的帮助。我不写代码,所以我尝试了几个小时来改变它但没有成功。