做成像树型菜单一样的效果,不过我先要把数据库的数据按大小类循环出来
//读出大类传一个主键ID SQL="select consultingid,Consultingname,pid from Consulting where pid=1 order by consultingid asc"
Call Data.Execute(SQL,RS,false)
while not RS.eof
ss=ss+""&RS("Consultingname")&""+","
dim cid
cid=RS("consultingid")
//Response.Write RS("Consultingname")
RS.movenext
wend
array=split(ss,",",-1,1)
Response.write array(2)
//根据大类传ID读出小类?
SQL="select * from consulting where pid='"&cid&"' order by consultingid asc "
call data.Execute(SQL,RS,false)
while not RS.EOF
tt=tt+""&RS("Consultingname")&""+","
Response.Write" "
dim did
did=RS("consultingid")
dim array2
RS.movenext
wend
array2=split(tt,",",-1,1)
Response.write array2(0)
//Response.Write "<br>"
Response.Write did
Response.Write"<br>"
//根据小类的ID找对应的问题
SQL="select a.consultingid,Consultingname,pid from consulting as a inner join consultingmodule as b on a.consultingid=b.consultingid where a.consultingid='"&did&"' order by a.consultingid asc"
SQL="select * from consultingmodule where consultingid='"&did&"'"
call data.Execute(SQL,RS,false)
while not RS.EOF
cc=RS("Consultingtitle")
//zz=RS("consultingproblem")
consulting3=consutling3+""&cc&"</br>"
RS.movenext
wend
//for i=0 to ubound(array)
// Response.write array(j)
//Response.Write(consulting3)
%>