>In a simple tree, one can easily see that using the title of a node as
>it's primary key is not smart... names can easily collide:
The names can definitely collide. But under a file system paradigm
the combination of name with parentID will be unique and define the
tree structure you mention:
> the other option is to parse your info from the URL, tokenizing per '/'
character, then do look ups recursively for each entry, finding the node
you're looking for.
>
This strikes me as the most logical solution to this particular
problem.
With regards,
Martijn Tonies
Database Workbench - dev
One of the ways around this that I've seen is to maintain an additional field for the
'full path' info.
so that you have:
table_name
---
node_id integer auto_increment
node_name varchar(50) not null
parent_id integer
full_path varchar(255)
the obvious downside is that your application