View Single Post

   
  #4 (permalink)  
Old 02-28-2008, 11:28 AM
=?iso-8859-1?B?Sm/jbyBNb3JhaXM=?=
 
Posts: n/a
Default 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 help on this?

Thaks in advance.

Reply With Quote