|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
> Why are you using that query rather than the one that Rik pointed you
> to? Because the query that Rik pointed me to, has a limited number of levels. |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
On Thu, 27 Sep 2007 11:32:17 +0200, João Morais <jcsmorais@gmail.com>
wrote: >> Why are you using that query rather than the one that Rik pointed you >> to? > > Because the query that Rik pointed me to, has a limited number of > levels. .... which is an unavoidable result from using the adjacency model. If your levels are limited, it's prefectly allright to use such a construct and a limited query. If you want both unlimited levels and a properly formated tree without recursive queries the nested set model is the only way to go that I know of. sorting by id as in your attempt doesn't make any sense at all BTW. It just 'happens' to be close to what you want. -- Rik Wasmus |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
> ... which is an unavoidable result from using the adjacency model.
While reading this thread (http://groups.google.pt/group/ comp.databases.mysql/browse_thread/thread/8292ae5b5ed55287/ d4da3530d6fb8f53?hl=pt-PT&lnk=gst&q=child+and +parent&rnum=1#d4da3530d6fb8f53) I got the ideia that it could be done in a different way. > If your levels are limited, it's prefectly allright to use such a construct and a limited query. Well what I was trying to do, was to have no predefined number of levels, but since this script will be used in a menu manager, it wont matter that much since most of the sites have 3/4 levels of menus. > sorting by id as in your attempt doesn't make any sense at all BTW. It > just 'happens' to be close to what you want. You're right mate, my bad, I was getting confused and had the *stupid* idea to try that out. Finally it's working now, i adopted the adjacency model. Thanks a lot for your . |
|
![]() |
| Outils de la discussion | |
|
|