PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Child and parent rows
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Child and parent rows

Réponse
 
LinkBack Outils de la discussion
Vieux 27/09/2007, 10h32   #9
João Morais
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Child and parent rows

> 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.

  Réponse avec citation
Vieux 27/09/2007, 17h41   #10
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Child and parent rows

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
  Réponse avec citation
Vieux 27/09/2007, 19h40   #11
João Morais
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Child and parent rows

> ... 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 .


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h51.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12878 seconds with 11 queries