中国教程网论坛's Archiver

6835gaoct 发表于 2008-4-29 00:53

asp代码学习与讨论

·sql="select * from article where indexpic<>'' order by Cdate(indate) desc"·
像这个中的 order by Cdate(indate) desc 是干什么用的是什么意思啊

6835gaoct 发表于 2008-4-29 00:59

<%
'nid=request.QueryString("nclass_id")
nid=1
set rs=server.createobject("adodb.recordset")
if nid=689 then                       
sql="select * from article where indexpic<>'' order by Cdate(indate) desc"
else
sql="select * from article where nclass_id='"& nid &"' order by Cdate(indate) desc"
end if
rs.open sql,conn,1,1
ii=1
if rs.eof then
        response.Write("暂时没有相关内容!")
end if
%>

也就是说这段代码是干什么用的  能解释一下吗

yunffff 发表于 2008-4-29 12:24

俺来学习的

孤星一号 发表于 2008-5-7 13:26

这个是用来判断提交过后的数据
如果满足条件的话 就按 Cdate(indate) desc来排序啊
否就用提交的根据表中的的 nclass_id 这个字段来 看是否与nid相等 再按by Cdate(indate) desc"
这个系统时间来排的啊

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.