Category tree |
(10-14-2017, 01:54 AM)glorsh66 Wrote: So in this case group is the same as parent Id? ID The primary key that auto increments. group You can select (*) all from database where group = group. This allows you to reuse this function for unlimited amount of category trees. Parent_Id Is the Id of the first item returned on Level one so everything that is a sub of id(Item Number 1) would be tagged with it's Id in the parent_id field. This groups all sub menus together under one item at a time. Sub_Parent_ID This will start being assigned at Level 2 because Level one has no Parent_Id but the Item directly under it Level 2 will have a Parent_Id of the first Level item. Level 2's parent_id and sub_parent_id will always be the same id. At level Three the parent_id will still be the first item at level one but the Sub_parent_id will point to the items id on level 2. (My brain hurts now ![]() Level You need the level to loop through all the items on each level and you need it to get the next level by incrementing the value by 1 and recalling the submenu function. All clear now? I hate recursion but it works pretty good when you get it down |
Messages In This Thread |
Category tree - by glorsh66 - 10-13-2017, 02:19 PM
RE: Category tree - by InsiteFX - 10-13-2017, 03:39 PM
RE: Category tree - by ChicagoPhil - 10-13-2017, 10:40 PM
RE: Category tree - by glorsh66 - 10-14-2017, 01:54 AM
RE: Category tree - by ChicagoPhil - 10-14-2017, 03:40 PM
|