On 28 Sep 2006, at 14:37, Earl Miles wrote:
The actual URL entered is: node/12/edit/foo
the simplistic version of the query would be:
SELECT * FROM menu WHERE path IN ('node/12/edit/foo', 'node/12/ edit', 'node/12/%/foo', 'node/%/edit/foo', 'node/%/%/foo', 'node/%/ edit', 'node/%') ORDER BY weight DESC;
This does have an order of N complexity in that there are 2^N-1 URL possibilities for every URL fragment you have -- which gets unwieldy around 7, but it is rare that you get URLs that long, though I imagine it does happen from time to time. At this time we believe this is an acceptable cost compared to the cost of the system it is replacing, while leaving us with maximum flexibility.
Interesting aproach, Earl. I think this might work, and relatively fast too. :-) -- Dries Buytaert :: http://www.buytaert.net/