28,391
社区成员
发帖
与我相关
我的任务
分享
sub selpcls(pid,lvl,cid)
dim rs
dim i
if pid=0 then
response.Write("<select name='pcls' id='pcls'>")
response.Write("<option value=""0"">--选择类别--</option>")
end if
set rs=conn.execute("select id,cls_name,pid from products_cls where pid="&pid)
do while not rs.eof
response.Write("<option value='"&rs("id")&"'")
if trim(cstr(cid))=cstr(rs("id")) then
response.Write("selected=""selected""")
end if
response.Write ">"
if lvl=0 then
response.Write("·"&rs("cls_name"))
else
for i=0 to lvl
response.Write(" ")
next
response.Write("┣"&rs("cls_name"))
end if
response.Write "</option>"
call selpcls(rs("id"),lvl+1,cid)
rs.movenext
loop
set rs=nothing
if pid=0 then
response.Write("</select>")
end if
end sub
字段类型是int varchar int