ASP 程序循环问题!高手帮忙解决
下面这段程序,怎么改成大于15条后,另起一列!!总共循环30条!是另起一列!!请高手帮忙!谢谢!SubShow_Hire(topNum,ShowType,Len1,Len...
下面这段程序,怎么改成大于15条后,另起一列!!总共循环30条!
是另起一列!!请高手帮忙!谢谢!
Sub Show_Hire(topNum,ShowType,Len1,Len2)
Dim rsh,sqlh
Set rsh=Server.CreateObject("ADODB.RecordSet")
sqlh="Select Top 15 * From job_c_hire Where hire_status=1 and hire_enddate>date() order by hire_announcedate desc"
rsh.Open sqlh,conn,1,1
If Not(rsh.Eof) Then
%>
<table width="380" border="0" cellpadding="0" cellspacing="0">
<%
i=1
Do While Not rsh.Eof
hire_place=left(rsh("hire_place"),Len1)
company_name=left(rsh("hire_comname"),Len2)
%>
<tr bgcolor='#FFFFFF'>
<td width="50" height="30" align="right"><img src="images/tp0011.gif" width="9" height="15" border="0"> </td>
<td><a href="company/hire_info.asp?id=<%=rsh("hire_id")%>" target="_blank"><%=hire_place%></a></td>
<td><%If rsh("hire_cmember")<>"" and rsh("company_id")<>"" Then%><a href="company/company_info.asp?id=<%=rsh("company_id")%>" target="_blank"><%=company_name%></a>
<%Else%><%=company_name%><%End If%>
(<%=rsh("hire_number")%>人)<%if datevalue(rsh("hire_announcedate"))=date() then%><img src="../images/new.gif"><%end if%><%if rsh("hire_command")=1 then%><img src="../images/hot.gif"><%end if%></td>
</tr>
<%
rsh.MoveNext
i=i+1
Loop
%> 展开
是另起一列!!请高手帮忙!谢谢!
Sub Show_Hire(topNum,ShowType,Len1,Len2)
Dim rsh,sqlh
Set rsh=Server.CreateObject("ADODB.RecordSet")
sqlh="Select Top 15 * From job_c_hire Where hire_status=1 and hire_enddate>date() order by hire_announcedate desc"
rsh.Open sqlh,conn,1,1
If Not(rsh.Eof) Then
%>
<table width="380" border="0" cellpadding="0" cellspacing="0">
<%
i=1
Do While Not rsh.Eof
hire_place=left(rsh("hire_place"),Len1)
company_name=left(rsh("hire_comname"),Len2)
%>
<tr bgcolor='#FFFFFF'>
<td width="50" height="30" align="right"><img src="images/tp0011.gif" width="9" height="15" border="0"> </td>
<td><a href="company/hire_info.asp?id=<%=rsh("hire_id")%>" target="_blank"><%=hire_place%></a></td>
<td><%If rsh("hire_cmember")<>"" and rsh("company_id")<>"" Then%><a href="company/company_info.asp?id=<%=rsh("company_id")%>" target="_blank"><%=company_name%></a>
<%Else%><%=company_name%><%End If%>
(<%=rsh("hire_number")%>人)<%if datevalue(rsh("hire_announcedate"))=date() then%><img src="../images/new.gif"><%end if%><%if rsh("hire_command")=1 then%><img src="../images/hot.gif"><%end if%></td>
</tr>
<%
rsh.MoveNext
i=i+1
Loop
%> 展开
2个回答
展开全部
sqlh="Select Top 15 * From job_c_hire Where hire_status=1 and hire_enddate>date() order by hire_announcedate desc"
改成
sqlh="Select Top 30 * From job_c_hire Where hire_status=1 and hire_enddate>date() order by hire_announcedate desc"
就可以循环30条了。至于你说的另起一列。你自己还没有弄清楚吧,原来的表格就有三列,15行了,你在原来的表格上再加一个列,再把30行三列的东西放进去,好像怪怪。你是不是想说另建一个表格啊
改成
sqlh="Select Top 30 * From job_c_hire Where hire_status=1 and hire_enddate>date() order by hire_announcedate desc"
就可以循环30条了。至于你说的另起一列。你自己还没有弄清楚吧,原来的表格就有三列,15行了,你在原来的表格上再加一个列,再把30行三列的东西放进去,好像怪怪。你是不是想说另建一个表格啊
展开全部
Select Top 15 *
你只选择了15条阿,不可能出现换行的...
如果要换
<table width="380" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<%
i=1
Do While Not rsh.Eof
hire_place=left(rsh("hire_place"),Len1)
company_name=left(rsh("hire_comname"),Len2)
%>
<tr bgcolor='#FFFFFF'>
<td width="50" height="30" align="right"><img src="images/tp0011.gif" width="9" height="15" border="0"> </td>
<td><a href="company/hire_info.asp?id=<%=rsh("hire_id")%>" target="_blank"><%=hire_place%></a></td>
<td><%If rsh("hire_cmember")<>"" and rsh("company_id")<>"" Then%><a href="company/company_info.asp?id=<%=rsh("company_id")%>" target="_blank"><%=company_name%></a>
<%Else%><%=company_name%><%End If%>
(<%=rsh("hire_number")%>人)<%if datevalue(rsh("hire_announcedate"))=date() then%><img src="../images/new.gif"><%end if%><%if rsh("hire_command")=1 then%><img src="../images/hot.gif"><%end if%></td>
</tr>
<%
rsh.MoveNext
i=i+1
if i = 15 then
response.write "</table></tr></td><tr><td><table>"
end if
Loop
%>
</table>
</tr>
</td>
你只选择了15条阿,不可能出现换行的...
如果要换
<table width="380" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<%
i=1
Do While Not rsh.Eof
hire_place=left(rsh("hire_place"),Len1)
company_name=left(rsh("hire_comname"),Len2)
%>
<tr bgcolor='#FFFFFF'>
<td width="50" height="30" align="right"><img src="images/tp0011.gif" width="9" height="15" border="0"> </td>
<td><a href="company/hire_info.asp?id=<%=rsh("hire_id")%>" target="_blank"><%=hire_place%></a></td>
<td><%If rsh("hire_cmember")<>"" and rsh("company_id")<>"" Then%><a href="company/company_info.asp?id=<%=rsh("company_id")%>" target="_blank"><%=company_name%></a>
<%Else%><%=company_name%><%End If%>
(<%=rsh("hire_number")%>人)<%if datevalue(rsh("hire_announcedate"))=date() then%><img src="../images/new.gif"><%end if%><%if rsh("hire_command")=1 then%><img src="../images/hot.gif"><%end if%></td>
</tr>
<%
rsh.MoveNext
i=i+1
if i = 15 then
response.write "</table></tr></td><tr><td><table>"
end if
Loop
%>
</table>
</tr>
</td>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询