今天在公司做一套会员系统,需要用到一个到期提示功能,既提前一周提示即将到期,
心理感觉挺简单,写的时候出现一点小意外,就把代码贴出来与大家分享!
转载请注明: 潍坊SEO 版权所有
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from huiyuan where datediff('d',now(),zhongriqi)<7 and datediff('d',now(),zhongriqi)>-1 order by zhongriqi asc",conn,1,1
if rs.eof and rs.bof then
response.Write("暂无会员信息")
else
do while not rs.eof%>
<a href="#"><img src="<%=rs("zhaopian")%>" width="120" border="0" title="<%=rs("xingming")%>"><br><%=rs("xingming")%> <font color="#FF0000">(<%response.Write DateDiff("d", Now, rs("zhongriqi"))&"天"%>)</font></a>
<%rs.movenext
loop
end if
rs.close
set rs=nothing%>
datediff('d',now(),zhongriqi)<7 and datediff('d',now(),zhongriqi)>-1 获取当前时间小于7天&大于-1天的所有数据
那里不懂请留言,我会给大家讲解的!
