Reply to Adjacency List Model Hierarchical Structure into HTML Structured List

Your name:

Reply:


Posted by Steve on 06/06/07 13:11

I have been studying the Adjacency List Model as a means of achieving
a folder structure in a project I am working on. Started with the
excellent article by Gijs Van Tulder

http://www.sitepoint.com/article/hierarchical-data-database

My database has this basic structure:

Id
FolderName
ChildOf

where ChildOf is the Id of the Folder that the current folder is
nested within.

Although I can use this to make indented text lists - I want the
output to be a hierarchical HTML structured list using <ol><li>
structures.

So, for example, my folders are:

News
-Government Information
-BBC
-National Press
Books
LIS
-UKEIG
-NPRIE

I want the output to be:

<ol>
<li>News
<ol>
<li>Government Information</li>
<li>BBC></li>
<li>National Press</li>
</ol>
</li>
<li>Books</li>
<li>LIS
<ol>
<li>UKEIG</li>
<li>NPRIE</li>
</ol>
</li>
</ol>

and for this to work irrespective of the number of levels in the
hierarchy.

Any ideas?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация