Question : Breadcrumbs or CFOUTPUT backwards?

I'm developing a web site with a database driven navigation structure. Every page location in the site is stored in a database along with an ItemID and PatentItemID resulting in a hierarchical structure. Everything is working perfectly apart from the breadcrumbs which should display the visitors location from the root or top level item down to the current page, e.g. Animals : Dog : Doberman : Female.

I am attempting to do this by:
 
1) querying the database for the ParentItemID of the current page from the URL
2) then querying the database again to find the ItemID that equals the ParentItemID returned from the previous step
3) setting the ParentItemID from the previous search and looping through steps 2 and 3 until a ParentItemID of 0 is returned

All this works, where I am having problems is when it comes to outputting the results they display (as far as the user is concerned backwards) e.g. Doberman : Dog : Animal : Female. I understand why they return this way but all my attempts to return them in reverse order have failed.

I've posted the code below to help you understand quite how I'm doing things.

Any help would be much appreciated, thank you in advance.

Peter

[CODE START]






SELECT *
FROM Items
WHERE Content_Link = '#URL.Content#'


mID#>




SELECT *
FROM Items
WHERE ItemID = #Variables.ParentItemID#






#Item# :



#Item#


[CODE END]

Answer : Breadcrumbs or CFOUTPUT backwards?









SELECT *
FROM Items
WHERE ItemID = #Variables.ParentItemID#











#a_item[i]# :




Here we go... tested an example my self as well, and this should work.

Mike
Random Solutions  
 
programming4us programming4us