高手帮我解答一段程序?感激不尽!

来源:百度知道 编辑:UC知道 时间:2024/06/22 12:33:07
</table>
<%
sql="select keyno,title,website,updatetime from miscell where baseclass='101' and classcode='900' and state='1' order by sortnum asc, keyno desc"
rs.open sql,cn,1,1,1
dim cnt
cnt=0
while not rs.EOf
cnt=cnt+1
if cnt<=5 then

%></td

这段程序实现了什么功能?
keyno是什么意思?一般表示什么的? 完整的程序后边还有...
sql="select keyno,title,website,updatetime from miscell where baseclass='101' and classcode='900' and state='1' order by sortnum asc, keyno desc"
rs.open sql,cn,1,1,1
dim cnt
cnt=0
while not rs.EOf
cnt=cnt+1
if cnt<=5 then

%></td>
<td width="96"><table width="95" height="19" border="0" cellpadding="0" cellspacing="0">

<tr>

sql="select keyno,title,website,updatetime from miscell where baseclass='101' and classcode='900' and state='1' order by sortnum asc, keyno desc"这是一句数据库查询语句,功能看起来像是查询出要显示到页面上超连接。
keyno是数据库miscell表里的一个字段,你的程序里没有调用到keyno,我猜差不多应该是主键一类的东东。

选出baseclass='101' and classcode='900' and state='1'的keyno,title,website,updatetime内容按照sortnum从小到大,和keyno从大到小的次序;如果找到一个CNT就加1;如果CNT小于5就……

先是从名叫miscell的数据库中查找出:
baseclass='101' , classcode='900' , state='1'的数据;
然后再按
sortnum从小到大(升序)和keyno从大到小(降序)进行排列;
再是如果从数据库中找到cnt这个结果,cnt就自加一次,再如果cnt小于等于5的话,then......

做jsp的吗??加油哈