| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 535 人关注过本帖
标题:为什么这里的显示时间都是一样的?
只看楼主 加入收藏
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
结帖率:92.31%
收藏
 问题点数:0 回复次数:5 
为什么这里的显示时间都是一样的?
<%dbdns="../"%>
<!--#include file="../inc.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../Style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bgnew">
  
  <tr>
     <td height="600" valign="middle">
    
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <%
  session("zp_cty")=replace(trim(Request.QueryString("zp_cty")),"'","''")
  zp_cty=replace(trim(Request.QueryString("zp_cty")),"'","''")
   set rs1=Server.CreateObject("adodb.recordset")
   sql1="select * from [job_zp] where zp_cty='"&zp_cty&"'"
   do while not rs1.eof
   rs1.open sql1,conn,1,3
   m=rs1("zp_dategq")
    hou=rs1("zp_date")
    hours=DateDiff("h",hou, Now)
    u=m-hours
    if u<1 then
     zp_id=replace(trim(rs1("zp_id")),"'","''")
    set rsa= Server.CreateObject("adodb.recordset")
    sqla="select * from [job_zp] where zp_id="&zp_id
    rsa.open sqla,conn,3,3
               rsa("zp_zt")=false
               rsa.Update()
                rsa.Close
               set rsa=nothing
             end if
             rs1.movenext
             loop
             rs1.Close
             set rs1=nothing
      set rs=Server.CreateObject("adodb.recordset")
  sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and zp_zt=true order by zp_id desc"
  rs.Open sql,conn,3,3
  if rs.eof then
  Response.write("<script language='javascript'>alert('该区域暂无招聘信息!');location.href='index1.asp';</script>")
  Response.End
  end if
  rs.pagesize=9
  pszie=rs.pagesize
  totalrecord=rs.RecordCount
  page=Cint(Request("page"))
  if totalrecord mod pszie=0 then
  totalpage=totalrecord\psize
  else
  totalpage=totalrecord\pszie+1
   end if
  if page=0 then
  page=1
  end if
  if totalrecord>0 then
  currentpage=page
  rs.absolutepage=currentpage
  end if
  for i=1 to 3
  if rs.eof then
  exit for
  end if
  %>
       <tr>
         <% for j=1 to 3
            if rs.eof then
            exit for
            end if
            %>
         <td height="155">
         <%
         if u<0 then
         Response.Write("<script language=javascript>alert('暂无相关招聘!');this.location='index1.asp';</script>")
         else
         %>
         <table width="224" height="142" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="114" align="center" valign="middle" background="images/btn.gif">
                   
               <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
            
                <tr>
                     <td width="69" height="30" align="center" valign="middle">&nbsp;</td>
                     <td width="155" height="50" class="topcenterwrite"><a href="msgg.asp?job_addtwo=<%=rs("zp_qu")%>&job_addone=<%=zp_cty%>&job_leibai=<%=rs("zp_id")%>&JOB_coname=<%=rs("zp_name")%>"><%=rs("zp_name")%></a></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">主办单位:</td>
                     <td height="25" class="topcenterwrite"><%=left(rs("zp_gong"),9)%></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">地址:</td>
                     <td height="25" class="center"><%=rs("zp_address")%>
                    </td>
                   </tr>
                   <tr>
                   
                   
                    <td height="25" colspan="2" align="center">招聘会剩余时间还有:<font color="ff0000"><%=u%></font>小时</td>
                    
                    </tr>
        
               </table>
              </td>
             </tr>
         </table>
         <%
         end if
         %>
         </td>
         <%
        rs.MoveNext
        next
        next
        set rs=nothing
        %>
       </tr>
     </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td align="right" valign="bottom">
           <%
           if totalpage>1 then
           %>
    当前是:[<font color="#ff0000"><%=currentpage%></font>]页&nbsp;总页:[<font color="#ff0000"><%=totalpage%></font>]页
      <% if currentpage>1 then
      Response.write"<a href=msg.asp?zp_cty="&session("zp_cty")&"&page="&"1"&">首页</a>"
    
      else
      Response.Write("<font color=#0d313d>首页</font>")
      end if
      %>
     |
      <%if currentpage>1 then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage-1)&"'>上一页</a>")
    
      else
      Response.write("<font color=#0d313d>上一页</font>")
      end if
      %>|
      <%
      if currentpage<totalpage then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(currentpage+1)&"'>下一页    </a>")
      else
      Response.write("<font color=#0d313d>下一页</font>")
      end if
      %>
      |
      <%if currentpage=totalpage then
      Response.Write("<font color=#0d313d>末页</font>")
      else
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage)&"'>末页    </a>")
    
      end if
      %>    <%
      end if
      %>&nbsp;</td>
         </tr>
    </table>

    </td>
  </tr>
</table>
</body>
</html>
今天早上不小心改掉了点东西,不知道改了哪里出现在时间都是一样的了。
谁 帮我看下,找找错误!
搜索更多相关主题的帖子: 时间 
2008-11-17 13:32
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
m=rs1("zp_dategq")
    hou=rs1("zp_date")
    hours=DateDiff("h",hou, Now)
    u=m-hours
这里zp_dategq是什么类型的数据日期型?数字型?
2008-11-17 14:57
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
收藏
得分:0 
[bo][un]yms123[/un] 在 2008-11-17 14:57 的发言:[/bo]

m=rs1("zp_dategq")
    hou=rs1("zp_date")
    hours=DateDiff("h",hou, Now)
    u=m-hours
这里zp_dategq是什么类型的数据日期型?数字型?

数字的
2008-11-17 15:02
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
m=rs1("zp_dategq")
    hou=rs1("zp_date")
    hours=DateDiff("h",Now,hou)
    u=hours
改成这样看看
2008-11-17 15:21
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
收藏
得分:0 
上面的U我测试过,是正常的,<%=u%>这个输出来就是不对的,
2008-11-17 15:39
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
收藏
得分:0 
斑竹,谢了,代码改过来了,
<%dbdns="../"%>
<!--#include file="../inc.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../Style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bgnew">
  
  <tr>
     <td height="600" valign="middle">
    
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <%
  zp_cty=replace(trim(Request.QueryString("zp_cty")),"'","''")
  set rs=Server.CreateObject("adodb.recordset")
  sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and zp_zt=true order by zp_id desc"
  rs.Open sql,conn,3,3
  if rs.eof then
  Response.write("<script language='javascript'>alert('该区域暂无招聘信息!');location.href='index1.asp';</script>")
  Response.End
  end if
  rs.pagesize=9
  pszie=rs.pagesize
  totalrecord=rs.RecordCount
  page=Cint(Request("page"))
  if totalrecord mod pszie=0 then
  totalpage=totalrecord\psize
  else
  totalpage=totalrecord\pszie+1
  end if
  if page=0 then
  page=1
  end if
  if totalrecord>0 then
  currentpage=page
  rs.absolutepage=currentpage
  end if
  for i=1 to 3
  if rs.eof then
  exit for
  end if
  %>
       <tr>
         <% for j=1 to 3
            if rs.eof then
            exit for
            end if
            %>
         <td height="155">
         <%
    m=rs("zp_dategq")
    hou=rs("zp_date")
    hours=DateDiff("h",hou, Now)
    u=m-hours
    if u<0 then
    Response.write(u)
    Response.end
    zp_id=rs("zp_id")
    set rsa= Server.CreateObject("adodb.recordset")
    sqla="select * from [job_zp] where zp_id="&zp_id
    rsa.open sqla,conn,3,3
    rsa("zp_zt")=false
    rsa.Update()
    rsa.Close
    set rsa=nothing
    Response.Write("<script language=javascript>alert('暂无相关招聘!');this.location='index1.asp';</script>")
    else
    %>
         <table width="224" height="142" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="114" align="center" valign="middle" background="images/btn.gif">
                 <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
              <td width="69" height="30" align="center" valign="middle">&nbsp;</td>
                <td width="155" height="50" class="topcenterwrite"><a href="msgg.asp?job_addtwo=<%=rs("zp_qu")%>&job_addone=<%=zp_cty%>&job_leibai=<%=rs("zp_id")%>&JOB_coname=<%=rs("zp_name")%>"><%=rs("zp_name")%></a></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">主办单位:</td>
                     <td height="25" class="topcenterwrite"><%=left(rs("zp_gong"),9)%></td>
                   </tr>
                   <tr>
                     <td align="right" class="rootcnet">地址:</td>
                     <td height="25" class="center"><%=left(rs("zp_address"),9)%>
                    </td>
                   </tr>
                   <tr>
                    <td height="25" colspan="2" align="center">招聘会剩余时间还有:<font color="ff0000"><%=u%></font>小时</td>
                    </tr>
                </table>
              </td>
             </tr>
         </table>
         <%
         end if
         %>
         </td>
         <%
        rs.MoveNext
        next
        next
        set rs=nothing
                %>
       </tr>
     </table>
       <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td align="right" valign="bottom">
           <%
           if totalpage>1 then
           %>
    当前是:[<font color="#ff0000"><%=currentpage%></font>]页&nbsp;总页:[<font color="#ff0000"><%=totalpage%></font>]页
      <% if currentpage>1 then
      Response.write"<a href=msg.asp?zp_cty="&session("zp_cty")&"&page="&"1"&">首页</a>"
    
      else
      Response.Write("<font color=#0d313d>首页</font>")
      end if
      %>
     |
      <%if currentpage>1 then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage-1)&"'>上一页</a>")
    
      else
      Response.write("<font color=#0d313d>上一页</font>")
      end if
      %>|
      <%
      if currentpage<totalpage then
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(currentpage+1)&"'>下一页    </a>")
      else
      Response.write("<font color=#0d313d>下一页</font>")
      end if
      %>
      |
      <%if currentpage=totalpage then
      Response.Write("<font color=#0d313d>末页</font>")
      else
      Response.write("<a href='msg.asp?zp_cty="&session("zp_cty")&"&page="&cstr(totalpage)&"'>末页    </a>")
    
      end if
      %>    <%
      end if
      %>&nbsp;</td>
         </tr>
    </table>

    </td>
  </tr>
</table>
</body>
</html>

现在的问题,又出来了我想在我想
 sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and zp_zt=true order by zp_id desc"
我把这条语句改为
sql="Select * from [job_zp] where zp_cty='"&zp_cty&"' and ( zp_zt=true or zp_cqxs=true ) order by zp_id desc"
这样的话,他会运行
if u<0 then
    zp_id=rs("zp_id")
    set rsa= Server.CreateObject("adodb.recordset")
    sqla="select * from [job_zp] where zp_id="&zp_id
    rsa.open sqla,conn,3,3
    rsa("zp_zt")=false
    rsa.Update()
    rsa.Close
    set rsa=nothing
    Response.Write("<script language=javascript>alert('暂无相关招聘!');this.location='index1.asp';</script>")
这句话,
下面的就无法显示了.
2008-11-17 16:04
快速回复:为什么这里的显示时间都是一样的?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020525 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved