I'm doing a webshop project at the time. It's sort of a "learn-php-and-mysql"-project, meaning I'm not very into php yet...
What I'm having trouble figuring out is this...
I have a table in mysql whit the following fields:
group_id - INT PRIMARY AUTOINCREMENT
group_name VARCHAR(64)
group_parent - INT
To illustrate the table, let's say I have the following rows in the table:
1 - Hardware - 0
2 - Software - 0
3 - Motherboards - 1
4 - Network - 1
5 - Operatingsystems - 2
6 - Socket A - 3
7 - Socket 478 - 3
8 - Albatron - 6
9 - Albatron - 7
--->
The menu it self would be a tree view like this:
Hardware
- Motherboards
--- Socket A
----- Albatron
--- Socket 478
----- Albatron
- Network
Software
- Operatingsystems
Currently I've coded this by usinbg nested loops in a three-level arcitecture... Thats NOT what I want...
What I want is an unlimited level iterational loop, so I can put in the levels as it suits me and my needs.
My programming knowledge is farely simple at the time, so please make things a clear as possible...
Regards and thanks in advance...
Roger Jensen
Norway
What I'm having trouble figuring out is this...
I have a table in mysql whit the following fields:
group_id - INT PRIMARY AUTOINCREMENT
group_name VARCHAR(64)
group_parent - INT
To illustrate the table, let's say I have the following rows in the table:
1 - Hardware - 0
2 - Software - 0
3 - Motherboards - 1
4 - Network - 1
5 - Operatingsystems - 2
6 - Socket A - 3
7 - Socket 478 - 3
8 - Albatron - 6
9 - Albatron - 7
--->
The menu it self would be a tree view like this:
Hardware
- Motherboards
--- Socket A
----- Albatron
--- Socket 478
----- Albatron
- Network
Software
- Operatingsystems
Currently I've coded this by usinbg nested loops in a three-level arcitecture... Thats NOT what I want...
What I want is an unlimited level iterational loop, so I can put in the levels as it suits me and my needs.
My programming knowledge is farely simple at the time, so please make things a clear as possible...
Regards and thanks in advance...
Roger Jensen
Norway
Comment