| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 469 人关注过本帖
标题:左边框格复制asp前台调用数据到右边框出现数据是重复的,请老师帮忙,我是新 ...
只看楼主 加入收藏
loenz
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-3-29
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
左边框格复制asp前台调用数据到右边框出现数据是重复的,请老师帮忙,我是新手。
图片附件: 游客没有浏览图片的权限,请 登录注册


我复制左边框格中的asp编码,到右边框里,想在加一段前台调用,我在后台栏目中添加了两条数据。可是前台调用确出现重复的。
(我是复制左边的asp编码的,两个一样没有改动,就是改了sql调用id)


<!--#include file="bttitle.asp" -->
<!--#include file="Inc/SysProduct.asp" -->
<script language="JavaScript">
<!--
var flag=false;
function DrawImage(ImgD){
 var image=new Image();
 image.src=ImgD.src;
 if(image.width>0 && image.height>0){
  flag=true;
  if(image.width/image.height>= 130/110){
   if(image.width>130){
    ImgD.width=130;
    ImgD.height=(image.height*130)/image.width;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
   ImgD.alt="点击查看详细信息...";
  }
  else{
   if(image.height>110){
    ImgD.height=110;
    ImgD.width=(image.width*110)/image.height;
   }else{
    ImgD.width=image.width;
    ImgD.height=image.height;
   }
   ImgD.alt="点击查看详细信息...";
  }
 }
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
  }
//--> </script>
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no '
win = window.open(mypage,myname,settings)
}
        </script>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css.css" rel="stylesheet" type="text/css">
<title><%=bttitle%></title>
</head><div align="center">
<!--#include file="top.asp" -->
<body>

<table width="914" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="244" valign="top"><!--#include file="left.asp" --></td>
    <td width="9" height="530" background="images/c_07.jpg">&nbsp;</td>
    <td width="661" valign="top"><table width="661" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="45" colspan="2" valign="bottom" background="images/c_08.jpg"><table width="661" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="574">&nbsp;</td>
            <td width="87" height="40"><a href="product.asp" class="am">&gt; 更多</a> </td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="181" colspan="2"><!--#include file="inpro.asp" --></td>
      </tr>
      <tr>
                <td height="45" colspan="2" valign="bottom" background="images/c_21.jpg"><table width="661" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="574">&nbsp;</td>
            <td width="87" height="40"><a href="news.asp" class="am">&gt; 更多</a> </td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="267" colspan="2" valign="top"><table width="328" border="0" cellspacing="0" cellpadding="0" height="8">
          <tr>
            <td></td>
            </tr>
        </table>
          <table width="293" border="0" align="center" cellpadding="0" cellspacing="0">
            <%
            set rs22 = server.CreateObject("ADODB.Recordset")
 sql22="select * from news where bigclassname='公司新闻' order by id desc "

rs22.open sql22,conn,3,1
   rs22.pagesize = 15
   m2=1
   %>
            <%
if not rs22.eof then
 Do While Not rs22.Eof and  m2 <= rs22.pagesize
            
            %>
            <tr>
              <td height="26" background="imagess/newline.jpg"><table width="549" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="278" height="33"><a href="shownews.asp?id=<%=rs22("id")%>"  class="a1">&nbsp;&nbsp;&nbsp;&nbsp;<%=left(rs22("title"),21)%></a><a href="shownews.asp?id=<%=rs22("id")%>"  class="a1">...</a>
<div align="right"><a href="shownews.asp?id=<%=rs22("id")%>"  class="a1"></a></div></td>
                  <td width="271"><table width="271" height="28" border="0" cellpadding="0" cellspacing="0">
                                          <%
            set rs5 = server.CreateObject("ADODB.Recordset")
 sql5="select * from news where bigclassname='植物指南' order by id desc "
rs5.open sql5,conn,3,1
   rs5.pagesize = 15
   m2=1
   %>
            <%
if not rs5.eof then
 Do While Not rs5.Eof and  m2 <= rs5.pagesize
            
            %><tr>
                      <td width="271"><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1">&nbsp;&nbsp;&nbsp;&nbsp;</a><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1"><%=left(rs5("title"),15)%></a><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1">...</a>
<div align="right"><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1"></a></div></td>
                    </tr><%      
     rs5.MoveNext
     m2=m2+1
loop
rs5.close
  end if
  set rs5 = nothing
  %>
                                      </table></td>
                  </tr>
                </table></td>
              </tr>
            <%      
     rs22.MoveNext
     m2=m2+1
loop
rs22.close
  end if
  set rs22 = nothing
%>
          </table></td>
        </tr>
    </table>
      <table width="100" border="0" align="center">
        <tr>
          <td><img src="guanggao/1.jpg" alt="" width="472" height="143" align="middle"></td>
        </tr>
      </table>
    </table>
</body><!--#include file="bottom.asp" --></div>
</html>


我复制左边框格中的asp编码,到右边框里,想在加一段前台调用,我在后台栏目中添加了两条数据。可是前台调用确出现重复的。
(我是复制左边的asp编码的,两个一样没有改动,就是改了sql调用id)
搜索更多相关主题的帖子: function false 
2011-03-29 11:57
loenz
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-3-29
收藏
得分:0 
自己顶一下。。
2011-03-29 11:59
loenz
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-3-29
收藏
得分:0 
<%
            set rs5 = server.CreateObject("ADODB.Recordset")
sql5="select * from news where bigclassname='植物指南' order by id desc "
rs5.open sql5,conn,3,1
   rs5.pagesize = 15
   m2=1
   %>
            <%
if not rs5.eof then
Do While Not rs5.Eof and  m2 <= rs5.pagesize
            
            %><tr>
                      <td width="271"><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1">&nbsp;&nbsp;&nbsp;&nbsp;</a><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1"><%=left(rs5("title"),15)%></a><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1">...</a>
<div align="right"><a href="shownews.asp?id=<%=rs5("id")%>"  class="a1"></a></div></td>
                    </tr><%      
     rs5.MoveNext
     m2=m2+1
loop
rs5.close
  end if
  set rs5 = nothing
  %>
还有上面m2=1  m2=m2+1 是什么意思。。。
2011-03-29 13:04
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:10 
赋值语句

哪边是左哪边是右?

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2011-03-29 14:31
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:10 
不知所云。

QQ:63572063
2011-03-29 18:03
loenz
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-3-29
收藏
得分:0 
改好了。。。。左。右循环位置错务,然后,,左右asp调用块没有用表格套上。。调一下表格的宽度就好了。

可是又出现问题了,现在左右数据都能独立显示了。。。可是左右出现的行数不能平行置顶,

 
2011-03-29 19:59
快速回复:左边框格复制asp前台调用数据到右边框出现数据是重复的,请老师帮忙, ...
数据加载中...
 
   



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

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