主题:  为什么我写的程序不能输出三行两列的数据(急求!!!)

林易

职务:普通成员
等级:3
金币:1.0
发贴:750
#12005/7/8 19:10:04
我写的函数用call在指定页面调用,没有一点错误提示,请给个输出三行两列的数据的例子,我都晕死了
<%sub showp()
sql="select picture_27.leaf_id as leaf_id, picture_27.picture_name as picture_name, picture_27.alt as alt,leaf_27.Brief,leaf_27.Title from leaf_27,picture_27 where picture_27.leaf_id=leaf_27.leaf_id  order by leaf_27.leaf_id desc"
		
		set rs_leaf_pic=dataExecute(sql,dsn_app)		
		dim maxperpage
maxperpage=16
		
     dim  a,i
        a=1
       i=0
   response.write("<TABLE width='222' border=0 align=center cellPadding=0 cellSpacing=0> <TBODY> <TR> ")
	/// str="<table width='274' border='0' cellspacing='0' cellpadding='0'>"
	do while not rs_leaf_pic.eof 
	Brief=rs_leaf_pic("Title")
	  if a mod 4=1 then
	
	
                        Response.Write("<TD width=44 height='133' vAlign=top></TD>")  
                           else
                         Response.Write("<TD vAlign=top width='130'><TABLE width=100% border=0 align='center' cellPadding=0 cellspacing='0'   borderColorLight=#000000 class=y> <TBODY><TR> ")             
                               'Response.Write(" <TD vAlign=top>"&Brief&"</TD>")
								       Response.Write(" <TD vAlign=top>ddfdfdf</TD>")
                                Response.Write("</TR>  </TBODY></TABLE> </TD> <TD vAlign=top width=48><font color='#FFFFFF'>54565656</font></TD>")
                          end if
                          
i=i+1
a=a+1
if rs_leaf_pic.eof then exit do
if i mod 4=0 then response.write "</TR><TR>"
if i>=MaxPerPage then exit do
rs_leaf_pic.movenext
loop
	response.Write("</TR></TABLE>")
%>



绿茶

职务:普通成员
等级:8
金币:10.0
发贴:19267
#22005/7/11 11:16:01
<%
dim i,flg
i=0
flg=0
response.write "<tr>"
do while not rs_leaf_pic.eof
i=i+1
if flg=1 then response.write "<tr>"
response.write "<td>"&Brief&"</td>"
if (i mod 2=0 and i>1) then
response.write "</tr>"
flg=1
else
flg=0
end if
rs_leaf_pic.movenext
loop



林易

职务:普通成员
等级:3
金币:1.0
发贴:750
#32005/7/15 17:36:39
谢谢朋友,我发现5d是个神奇的地方,来问个问题老没有人吊你,郁闷之下自己总能解决


sub showc27_picture_1(node_id)
		sql="select top 6 picture_27.leaf_id as leaf_id, picture_27.picture_name as picture_name, picture_27.alt as alt,leaf_27.Brief,leaf_27.Title,leaf_27.wylx,leaf_27.zlhx,leaf_27.lpwz,leaf_27.perprice from leaf_27,picture_27 where picture_27.leaf_id=leaf_27.leaf_id  and leaf_27.Node_id="&node_id&" order by leaf_27.leaf_id desc"

		set rs_leaf_pic=dataExecute(sql,dsn_app)		

Response.Write ("<table width=""100%"" border=""0"" cellspacing='1' cellpadding=""0"">")
row_count=1 
Response.Write ("	 <tr align=""left"">")
Do While Not rs_leaf_pic.EOF
pic_name=rs_leaf_pic("Picture_name")
pic_id=rs_leaf_pic("leaf_id")
wylx=left(rs_leaf_pic("wylx"),5)
zlhx=left(rs_leaf_pic("zlhx"),5)
lpwz=left(rs_leaf_pic("lpwz"),5)
perprice=left(rs_leaf_pic("perprice"),5)
Response.Write ("	  <td> ")
Response.Write ("	   <table  height=""110"" border=""0"" cellpadding=""0"" cellspacing='0' class='zt'cellspacing='1'> ")
Response.Write ("	    <tr>")
Response.Write ("	     <td  rowspan=""4""><a href='/modules/"&module_folder&"/front/Leaf_info.asp?leaf_id="&pic_id&"'target='_blank'><img src='/modules/"&module_folder&"/picture/"&pic_name&"' width='124' height='88' border='0'></a></td>")
Response.Write ("<td width=""4%"" rowspan=""4"">&nbsp;</td>")
Response.Write ("	     <td  width='24%'>物业类型:</td>")
Response.Write ("	     <td >"&wylx&"</td>")
Response.Write ("	    </tr>")
Response.Write ("	    <tr  width='24%'>")
Response.Write ("	     <td>主力户型:</td>")
Response.Write ("	     <td>"&zlhx&"</td>")
Response.Write ("	     </tr>")
Response.Write ("	    <tr>")
Response.Write ("	     <td>楼盘位置:</td>")
Response.Write ("	     <td>"&lpwz&"</td>")
Response.Write ("	    </tr>")
Response.Write ("	    <tr>")
Response.Write ("	     <td>平米均价:</td>")
Response.Write ("	     <td>"&perprice&"</td>")
Response.Write ("	    </tr>")
Response.Write ("	   </table>")
Response.Write ("	  </td>")
if row_count mod 2 <>0 then
end if
if row_count mod 2 =0 then
Response.Write ("	 </tr>")
end if

rs_leaf_pic.MoveNext
row_count=row_count+1
Loop
rs_leaf_pic.close
Response.Write ("</table>")	   
	  set rs_leaf_pic=nothing
	
end sub 



蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#42005/7/16 2:09:24
林易在上个帖子中说
引用:
谢谢朋友,我发现5d是个神奇的地方,来问个问题老没有人吊你,郁闷之下自己总能解决



是啊,偶就这样,懒得看别人代码,还是自己动脑省力些,所以动下脑就出来了。
为什么非要别人代码或有个参考,不相信自己做出来的比参考的方法更好呢


非常大鱼

5D荣誉斑竹

职务:普通成员
等级:3
金币:10.0
发贴:1480
#52005/7/18 6:08:06
林易在上个帖子中说
引用:
谢谢朋友,我发现5d是个神奇的地方,来问个问题老没有人吊你,郁闷之下自己总能解决



起码有人回答你了,这样说不好.
另外你的解决方式赘了点,如果没有BUG,也只能打60分.