I'm making a link management system which I know upfront I can do 99% of the work. The part that boggles me is how some scripts allow infinite categories (and infinite categories DEEP!). How is it possible to set up infinite levels of categories for each link?
I started going this route and using the URL as a common field to relate to another table. That's fine and dandy, I can give a single url a million different categories this way. But I'm not sure how to make categories have categories of their own, especially since the end user will create the levels via a web form during configuration.my $sth = $dbh->prepare( "CREATE TABLE IF NOT EXISTS categories ( id int auto_increment NOT NULL, url VARCHAR(300) NOT NULL, primary key (id) )"); $sth->execute();
Some sample data:
As shown above, there are multiple levels of sub categories for the major categories. I am totally confused at where to start. This will be a MySQL database.Large Animals - Small Animals - Ocean Life - 4-legged - 4-legged - Under 12" - 2-legged - 2-legged - 12" - 3' - *invertebrate *carnivore *herbavore
My guess is I'd have one table categories for all the first-level categories. Then I could create tables for every single next-level category saving the information of the categories it relates to in each of them. But THAT seems wrong and definitely a waste.
In reply to database table advice by coldfingertips
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |