Reply to Re: reading in multiarray

Your name:

Reply:


Posted by Steve on 04/19/07 22:29

"Jon Slaughter" <Jon_Slaughter@Hotmail.com> wrote in message
news:NORVh.1282$H_.157@newssvr21.news.prodigy.net...
|I wrote some code to read in a file
|
| and I'm curious as to is this is a decent way to do it or if there is a
much
| more elegant way. Essentially I want to convert a text file that into a ul
| in html for my nav menu. This way I can easily add and remove links
without
| messing with any other code(Except of course where the link points to).
|
| Anyways, the code works as far as getting the links into a multi-array
that
| I can work with but not sure if its the best way or not.

create table menu
(
id int not null primary ,
parent int null default 0 ,
node varchar(255) not null ,
action text not null
);

now traverse the data to link each node to it's parent. you may only want to
run this once. in that case, save the menu in a session var. if that var
isn't set, you know you should build the menu again.

i know i'm talking about databases, however a file is not an adequate
solution...especially the kind of format you're talking about. an xml file
*could* be a close second to what i've proposed and you could utilize xslt
to render the menu. however, it's not as easily maintained as db data.

[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

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