Jump to content

Predefined Categories Table


Recommended Posts

Hi all,

 

I need to produce a table holding a list of categories, On my page, depending on the user_level they can choose x amount of categories. Can I ask whats the most efficient way of achieving this?

 

parent_categories (id, name)

secondary_categories (id, parent_id, name)

member_plan (member_id, member_categories)

 

The above is my theoretical idea of how it should look, what are your thoughts?

Link to comment
https://forums.phpfreaks.com/topic/201426-predefined-categories-table/
Share on other sites

and its repeated if this makes sense?

 

You mean a Sub under a Sub under a Sub under a Sub ..? Most use the Adjacency List Model although there are better alternatives like a Binary Tree:

 

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Hi Ignace, No only 1 sub,

There will be 2 dropdowns...

 

[Primary Category] - [sub Category]

 

When both are selected another option below will appear such as

 

[Musician] - [Cover Band] <--- selected option

Primary Category - Sub Category <--- Second option now appears.

 

I just need advice on how to best store these selected categoris in a table? Hope this isnt too confusing!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.