[plug] PHP / mySQL - recursive query problem
hooker at iinet.net.au
hooker at iinet.net.au
Tue Mar 30 15:46:24 WST 2004
Quoting Ady Gould <KiltOtter at bdu.org>:
> > Your table structure is precisely right :)
> >
> > Ady: What precisely is the nature of this project if its not
> > a rude or business secret trashing sorta question?
>
> It's actually part of a project for my students - I came up with the idea of
> the self referencing table to store resources and categories. More precisely
> the categories that the resources belong to:
>
> Business -> Finance -> Accounting
> Business -> Finance -> Banking
> Computing -> Software -> Microsoft -> Office
> Computing -> Software -> Microsoft -> Office -> Powerpoint
> Computing -> Software -> Microsoft -> Office -> Word
> Computing -> Hardware -> Motherboards
> Etc
As an alternative approach, this article is interesting :
http://www.sitepoint.com/article/hierarchical-data-database/
I implemented something very similar once, many moons ago, and it was pretty fast.
Hooker
More information about the plug
mailing list