First of all, I must say that I am reading this forum since 3 days ago searching for some help.
Still, no good answer (for me) to my problem.
So, what I have:
- a table CATEGORIES;
- four columns: id, categoryname, parentname and observations.
I already managed to insert data into the table from a form, also to view, edit and change it.
There are no limitations: every category can be parent for another new inserted subcategory (but a subcategory can have just one parent at a time), I can change subcategories to have another parent etc.
NOW!
I want to:
1. retrieve the name of the TOPCAT (select * from, limit 1... simple)
2. display it name as a top tablecell
3. with his name as parentname to retrieve all his childs (select * from categorii where previous categoryname is a parentname)
4. display their names into subcells under the top cell (somehow, managed)
5. retrieve all childs using names from 4. (biiiig problem starting from here...)
6. display under
and so on for every subsubsub...
Using while in while in while lops, all I was able to do so far was to get even one branch from the top to the bottom, even just topcell and first row of subcells.
My final work should look like a upside down tree.
Pls, for now just don't ask for my php code... I already delete it 3 times...
I wish to see a clean and simple idea, I am still a newbie.
Thanks in advance.