循环出数据 要头条数据为红色显示 怎么弄 asp的

来源:百度知道 编辑:UC知道 时间:2024/06/01 10:53:23

例子代码:
Set rs = Server.CreateObject("Adodb.Recordset")
exec="select top 5 * from cmin where lipa='图片新闻' order by id desc"
rs.open exec,conn,1,1
i=1
do while not rs.eof
if i=1 then response.write "<font color=red>"
'这里编写你原来的输出语句
if i=1 then response.write "</font>"
i=i+1
rs.movenext
loop

读数据库的时候先读出一条数据 把样式定义为红色显示,然后移动到下一条再循环就可以了