Array to print in unordered list

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kuikel
Forum Newbie
Posts: 1
Joined: Tue Jul 22, 2008 11:00 am

Array to print in unordered list

Post by kuikel »

Hi Everyone..

I'm trying to get the data from table (select id, parent, name, orders from table) where all the data form a hiearchy with the parent. (so eg: 5, 6 categories are child of 3 and child 3 is child of 1).

I've using MVC method. so I will use function(recursive at the moment) to get data in array. Also, I need to print those hierchical data in unordered list in view. I've done it but its not doing exactly how i want (when printing arrays.. sometimes li is not closing or etc).

So can I get some idea to create data hin hierchical order and display them in list.

if anyone has done this and has got a code, would be so so so great..

thanks in ad.
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: Array to print in unordered list

Post by WebbieDave »

kuikel wrote:I've done it but its not doing exactly how i want
Can you post what you've done so far?
Post Reply