ASP问题,高手进 ,着急`~`
以下代码
<%
set rs = conn.execute("select count(ck) from [xc_mail] where toname='"&session("name")&"' and ck='1'")
%>
<a href="new.asp" target="mainFrame">您好,您有<font color="red"><%=rs(0)%></font>封新邮件!</a>
<%
rs.close
set rs=nothing
%>
我想修改为,在统计出rs(0)是0,也就是没有新的邮件的时候 显示“对不起 你没有新的邮件”
我该怎么做呢?
参考答案:<%
set rs = conn.execute("select count(ck) from [xc_mail] where toname='"&session("name")&"' and ck='1'")
if rs(0)<>0 then
%>
<a href="new.asp" target="mainFrame">您好,您有<font color="red"><%=rs(0)%></font>封新邮件!</a>
<% else %>
对不起 你没有新的邮件
<%
end if
rs.close
set rs=nothing
%>