标注已读的留言

jsp中   readtag 0 未读 1已读
message.jsp
<a href="../advertiser/message_detail.jsp?id=<%=id%>"> <%=title %>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<%
                  if(readtag==0)
                  {
                   %>
                  <font   color= "#ff0000 ">(未读)</font>
                 <%
                 }
                 %>

message_detail.jsp
     int readtag= rs.getInt("readtag");
       if(readtag==0){
          db.executeUpdate("update saysomething set readtag=1 where id="+id);
         }

 

 

 

 

 

 

 

在Online_view.asp(显示用户信息页)
strSql= "select   *   from   (表名)..   ...(查询数据库部分加入下面代码)

if   not   rs.eof   then
    rs( "readTag ")=1
    rs.update
end   if

作用就是当读某ID后便向数据库的readtag写入值“1”


然后在Register_view.asp(显示已经注册的用户列表页)

在你想要显示是否已读标准的地方加入如下代码:
<%
exec= "select   readtag   from   Online   where "
if   rs( "readTag ")=0   then
      response.write   " <font   color= '#ff0000 '> "   &   "news   "& " </font> "
else
      response.write( " ")
end   if

作用是正如楼上说的,1代表已读,0代表未读
未读的记录就显示红色的“news”标志
已读的记录留空
     
    %>  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值