/ Published in: ASP
Expand |
Embed | Plain Text
sub getChildren(rowId) Dim sSQL,oRS,itemArray,i sSQL = "SELECT rowId,rowName,parent_id from table WHERE parent_id = " & rowId set oRS = cn.execute(sSQL) itemArray = oRS.getRows() if isArray(itemArray) then dim rowId,rowName,parent_id for i = 0 to ubound(itemArray,2) rowId = itemArray(0,i) rowName = itemArray(1,i) parent_id = itemArray(2,i) call getChildren(parent_id) 'pass in parent id here response.write " >> <a href=""page.asp?p="&rowId&""">"&rowName&"</a>" next end if end sub
You need to login to post a comment.
