ASP数组问题(急)
qxidStr0=split(qxidStr,",")已把数值放到数组qxidStr0里了。例如qxidStr0里的值为(1,2,3,4,5,6,7)<%sql="sel...
qxidStr0=split(qxidStr,",") 已把数值放到数组qxidStr0里了。
例如qxidStr0里的值为(1,2,3,4,5,6,7)
<%sql = "select * from class order by classid "
set rs =killsqlconn.execute( sql )
while not rs.eof
i=0
ok=0
if qxidStr <> "" then
for i=0 to ubound(qxidStr0)
if rs("classid")=int(qxidStr0(i)) then
ok=1
end if
next
end if
if ok=1 then
%>
<%=rs("classname")%><br />
<%
end if
i=i+1
rs.movenext
wend
%>
下面这段是想拿一级栏目的ID和数组中比较,如果存在则显示。但是不能成功,哪位高手来帮我看看 展开
例如qxidStr0里的值为(1,2,3,4,5,6,7)
<%sql = "select * from class order by classid "
set rs =killsqlconn.execute( sql )
while not rs.eof
i=0
ok=0
if qxidStr <> "" then
for i=0 to ubound(qxidStr0)
if rs("classid")=int(qxidStr0(i)) then
ok=1
end if
next
end if
if ok=1 then
%>
<%=rs("classname")%><br />
<%
end if
i=i+1
rs.movenext
wend
%>
下面这段是想拿一级栏目的ID和数组中比较,如果存在则显示。但是不能成功,哪位高手来帮我看看 展开
展开全部
<% dim sql,j
sql = "select * from class order by classid "
set rs =killsqlconn.execute( sql )
while not rs.eof
j=0
ok=0
if qxidStr <> "" then
for i=0 to ubound(qxidStr0)
if rs("classid")=int(qxidStr0(i)) then
ok=1
end if
next
end if
if ok=1 then
%>
<%=rs("classname")%><br />
<%
end if
j=j+1
rs.movenext
wend
%>
asp中变量的声明不是强类型,声明时用dim显示声明
sql = "select * from class order by classid "
set rs =killsqlconn.execute( sql )
while not rs.eof
j=0
ok=0
if qxidStr <> "" then
for i=0 to ubound(qxidStr0)
if rs("classid")=int(qxidStr0(i)) then
ok=1
end if
next
end if
if ok=1 then
%>
<%=rs("classname")%><br />
<%
end if
j=j+1
rs.movenext
wend
%>
asp中变量的声明不是强类型,声明时用dim显示声明
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询