Advertisement

05.07.2008 at 01:40PM PDT, ID: 23384231 | Points: 500
[x]
Attachment Details

Sorting Many to Many Heirarchal Category View

Asked by polyhedron12 in PHP and Databases, Algorithms

Tags:

database structure

Table: Category
categoryID - Auto increment
parentID - refers to parent category stored in THIS Table
categoryName - self explanatory

Example Data
categoryID | parentID | categoryName
---------------------------------------------
0                 | -1           | Home
1                 |  0           | Category 1
2                 |  0           | Category 2
3                 |  2           | Category 3
4                 |  0           | Category 4
5                 |  1           | Category 5

I've been struggling with this for weeks now. All I want to do is display the information as shown. I'm almost certain this will have to be some sort of recursive function. I just haven't been able to get it just right.

Home
>> Category 1
>>>>Category 5
>> Category 2
>>>> Category 3
>> Category 4Start Free Trial
[+][-]05.07.2008 at 07:13PM PDT, ID: 21521861

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 07:28PM PDT, ID: 21521914

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 05:34AM PDT, ID: 21538766

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 05:50AM PDT, ID: 21538843

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628