--- douglass_davis@stripped wrote:
In my opinion:
The easiest thing for you to do right now would be a
ID (primary key) NAME PARENTID
You don't need PARENT, because you have the PARENTID,
you can always retrieve parent. Although... i still
think it would have been simpler to do separate tables
for each taxonomic level, and this single table design
may cause problems down the road if you start adding
more fields... but anyway.
Keep it simple. One ID is all you need to identify
any row. As far as the URL, you could use the scheme
i gave earlier for the URLs (if you can absolutely
guarantee 100% every NAME-PARENT combination will be
unique), but it would be more complicated PHP code and
more complicated queries, and links would break when
spellings changed. Just use the ID in the URL, it's
If you add or delete rows, or change spelling, the
keys stay the same, primary keys don't change. Just
make sure you don't delete anything's parent and
everything will be just fine.
* * * * *
OK, thanks. I'll give that a try. I'll probably try to
combine it with the recursive array described at
(after I learn how to do it).
Let me throw one more curve ball at you, though. I now
understand that I can't combine my primary key with
the field Name, like 8leo. But do you know if I could
combine numerals from this "tree traversal" script
Here's why numerals appeal to me. If I combine fields
like Name/Parent ID - e.g. leo/Pan, then it will be
more difficult when I want to separate them. If I
combine Name with a numeral - e.g. leo/8 - then all I
need is a script that weeds out all numerals. I think.
Does this make sense?
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around