Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-12-2002, 12:42 PM   PM User | #1
Pieter
New to the CF scene

 
Join Date: Aug 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Pieter is an unknown quantity at this point
Question Linked list problem

Hi,

I have written a few lines in ASP but I'am not sure if it is the fastest way of doing it.

My problem:
I have a one table entitled tblCat with a unique field ID. Each row of the table is linked to a child (row). For example:
ASP :: Scripts :: clocks
The three categories are three rows of my table for example
ASP (ID=1/Child=0)
Script (ID=2/Child=1)
Clocks (ID=3/Child=2)
Date&time (ID=4/child=1)

Now I have written the following code the get the string
Home :: ASP :: Scripts :: clocks

<!-- #include file="conn.asp" -->
<%
str = ""
first = true
item = request.queryString("id")
if(item <> "") then
while (item <> 0)
objRS.open "Select * from tblCat where id="& cint(item),objConn,1,2
item = objRS("child")
if first = true then
str = objRS("name")
else
str = "<a href='link.asp?id="& objRS("id") &"'>"& objRS("name") & "</a> :: " & str
end if
first = false
objRS.close()
wend
str = "<a href=link.asp>Home</a> :: " + str
response.write(str)
end if
%>

Thanks in advance
Pieter
Pieter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:47 AM.


Advertisement
Log in to turn off these ads.