php - Foreach group and subgroup dynamic loop -
I have this problem. I have a table of the group (below). This is a recurring type of table because in each new group A similar table can have an original group. Therefore, we effectively have a group & gt; Sub group & gt; Sub group & gt; Subgroup worm model Then something that looks like this looks like this: Window & gt; Small window & gt; Paint I have created forms and tables to create the group but this is a database query and I think that there is a problem getting data in the above format. The bit too big to handle my brain: ( I am doing this in this format because I want to have complete control over the depth of groups and subgroups. Actually there is no code to give an example because I am after solving this problem. ** UPDATE ** A little more specific: I want to go to the list each Parent group (such a group that has 0 sets in parent ) And if it is an immediate sub group, then that group is immediately subgroup (if any) etc., etc. If you want to do this, you have to move the whole table to PHP and then search with php. However, there is a similar method that you can use this kind of structure How it can be managed, it is very described: ** ID | Label | Parent_id ** 1 | Terrace 0 2 | Window | 0 3 | Wall | 0 4 | Short | 2 5 | Big | 2 6 | Big | 1 7 | Paint | 4
Comments
Post a Comment