Discussion: hierarchical problem
Afficher un message
Vieux 27/03/2008, 17h31   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: hierarchical problem

On Thu, 27 Mar 2008 15:46:58 +0100, sebastien.ramage@gmail.com
<sebastien.ramage@gmail.com> wrote:

> Hi !
>
> I've a problem, I have a table "messages" with 3 fields :
> "id","name","parent"
> parent can be NULL or a id number
>
> example :
> id | name | parent
> 1 | toto | NULL
> 2 | titi | NULL
> 3 | test | 2
> 4 | new | NULL
> 5 | other | 3
> 6 | blabla | 4
>
> I want to get a hierarchical list like this
>
> 1 toto
> 2 titi
> -> 3 test
> -> 5 other
> 4 new
> -> 6 blabla
>
> Is it possible ? directly from mysql or by using some php?


http://dev.mysql.com/tech-resources/...ical-data.html
--
Rik Wasmus
  Réponse avec citation
 
Page generated in 0,04752 seconds with 9 queries