Structure MySQL database for a select box.
Posted: Sun Nov 23, 2003 10:43 am
I'm having some problems with structuring the database for it to progress the data as I want it. I have a table that looks something like this:
The levels are set as where the category should be shown, 0 is for top category and so on. Now, using the select box tag I want it to display this:
I'm not sure how to go about this. All categories including all sub categories will be created on the fly by an online editor tool so they must be kept in same table to work I believe.
Any suggestions on this would be appreciated
Code: Select all
categories:
--------------------------------------------------------------
uid group_id level group_name
--------------------------------------------------------------
1 1 0 category#01
2 2 0 category#02
3 1 1 sub category#01
4 1 2 sub category#02
5 2 1 sub category#03Code: Select all
category#01
sub category#01
sub category#02
category#02
sub category#03Any suggestions on this would be appreciated