| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 452 人关注过本帖
标题:求教,来个高手指点一下!
只看楼主 加入收藏
Mrlomo
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-9-16
收藏
 问题点数:0 回复次数:3 
求教,来个高手指点一下!
<div class="weekly_content_list">
    <%'开始分页
    Const MaxPerPage=2
       dim totalPut  
       dim CurrentPage
       dim TotalPages
       dim j
      
        if Not isempty(request("page")) then
          currentPage=Cint(request("page"))
       else
          currentPage=1
       end if
 Set Rs = Db.CreateRS()
 sql="select * from weekly"
 sql="select * from weeklySort where ID>0"
 namekey=FLib.SafeSql(Request("namekey"))
 if namekey<>"" then
 sql=sql&" and SortName like '%"&namekey&"%'"  
 end if
 if SortID<>"" then
 sql=sql&" and SortID="&SortID&""
 end if
 sql=sql&" order by PX desc"
 Rs.Open Sql, Db.Conn, 1, 1
   
    if err.number<>0 then
    response.write "数据库中无数据"
    end if
   
      if rs.eof And rs.bof then
           Response.Write "<p align='center' class='contents'> 没有此类信息!<a href='#' onclick='history.go(-1);'>返回上一步</a></p>"
       else
       totalPut=rs.recordcount

          if currentpage<1 then
              currentpage=1
          end if

          if (currentpage-1)*MaxPerPage>totalput then
         if (totalPut mod MaxPerPage)=0 then
           currentpage= totalPut \ MaxPerPage
         else
            currentpage= totalPut \ MaxPerPage + 1
         end if
          end if

           if currentPage=1 then
               showContent
               showpage totalput,MaxPerPage,"weekly.asp"
           else
              if (currentPage-1)*MaxPerPage<totalPut then
                rs.move  (currentPage-1)*MaxPerPage
                dim bookmark
                bookmark=rs.bookmark
                showContent
                 showpage totalput,MaxPerPage,"weekly.asp"
            else
             currentPage=1
                showContent
                showpage totalput,MaxPerPage,"weekly.asp"
           end if
        end if
              end if

       sub showContent
          dim i
       i=0
   %>
                <div>
                  <%
        cols=3
do while not rs.eof
if abc mod cols=0 then response.Write("<tr>")
abc=abc+1
%>
           
               <div class="weekly_content_list_table">
                  <div class="weekly_content_list_time">
                    <img src="../<%=rs("SmallPic")%>"  />
                  </div>
                  <div class="weekly_content_list_name" style="background-color:#999; text-align:center; font-size:17px;"><%=rs("SortName")%></div>
                  <div class="weekly_content_list_name">
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                   <li><a href="#">小标题2</a></li>
                  </div>
               </div>

<%
  i=i+1
         if i>=MaxPerPage then Exit Do
          rs.movenext
          loop
          rs.close
         set rs=nothing%>
                </div>
            </div>
搜索更多相关主题的帖子: where request Request div sql 
2011-09-16 10:39
Mrlomo
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-9-16
收藏
得分:0 
我想在<li><a href="#">小标题2</a></li>替换成数据库里的内容,但是试了很多方法都不行,求高手指点一下
2011-09-16 10:40
Mrlomo
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-9-16
收藏
得分:0 
来个人看一下
2011-09-16 10:49
Mrlomo
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-9-16
收藏
得分:0 
又是个死论坛
2011-09-16 11:11
快速回复:求教,来个高手指点一下!
数据加载中...
 
   



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

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