有分类(家电、医疗、工业)产品,怎么分类显示?
数据库产品表
数据库产品分类表
程序代码:
<% sql = "" sqlc = "" isAdd = 1 content = "" lm = "" if parentid <> "" then sql = "select * from producttype where id = "&parentid sqlc = "select * from producttype where lmid = '"&parentid&"'" else if id <> "" then sql = "select * from producttype where id = "&id sqlc = "select * from producttype where lmid = '"&id&"'" else sql = "" sqlc = "" end if end if if sql = "" then lm = "设计案例" linkUrl = "case_list.asp" else Set rs = Server.CreateObject("ADODB.RecordSet") rs.Open sql,conn,1,1 if not rs.eof then isAdd = rs("isAdd") lm = rs("lm") content = rs("content") linkUrl = "" if rs("linkUrl") is null or rs("linkUrl") = "" then linkUrl = "case_list.asp?id="&rs("id") end if end if rs.close set rs = nothing end if %> <div class="caseboxList"> <% if isAdd = 1 then %> <ul class="caseboxListPro"> <% if id <> "" then sql = "select * from products where lm = "&id&" order by sortid,bookid desc" else sql = "select * from products order by sortid,bookid desc" end if %>response.write(sql)结果是select * from products order by sortid,bookid desc,求高手指点