Discussion: Child and parent rows
Afficher un message
Vieux 26/09/2007, 19h04   #4
João Morais
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Child and parent rows

Im having a couple of troubles trying to solve the following problem,

CREATE TABLE IF NOT EXISTS menuitens (
id int(11) NOT NULL auto_increment,
idMenu int(11) NOT NULL default 0,
idParent int(11) NOT NULL default 0,
position int(11) NOT NULL default 0,
PRIMARY KEY (id)
) TYPE=INNODB;

With this I will have a tree structure with rows ordered by position
field example:

position - field name

1 - a
1 - a1
1 - a11
1 - a11
2 - a2
1 - a21
3 - a3
4 - a4
1 - a41
2 - a42

....

Although I can select every rows I cannot order them by position field
and keep the "parent-child" grouping, can any one on this?

Thaks in advance.

  Réponse avec citation
 
Page generated in 0,04342 seconds with 9 queries