查询并排序文章列表标签

2023-12-14 15:48 小编

可根据分类ID与条件查询前几条最新文章列表并进行排序,用循环语句输出。

参数说明:

channel_name:频道名称

category_id:栏目分类ID,0显示所有分类

top:显示的条数,0为显示所有

strwhere:SQL查询语句

orderby:SQL排序语句,asc顺序desc倒序

get_article_list(channel_name, category_id, top, strwhere, orderby)

<!--示例一:查询新闻频道分类ID为1的8条信息,按字段sort_id数字倒序排序-->
<%set DataTable nlist=get_article_list("news", 1, 8, "status=0", "sort_id desc")%>
<!--使用foreach循环输出-->
<%foreach(DataRow dr in nlist.Rows)%>
  新闻标题:{dr[title]}
<%/foreach%>


在线咨询 拨打电话

电话

13363039260

微信二维码

微信二维码