how to get these values from Database, codeigniter Active record
===

hi i am using `codeigniter` . i have a table like this .

    PreferenceID | PreferencParentID |   Value
       1         |      0            | Fashion
       2         |      0            | music
       3         |      1            | Men's fashion
       4         |      1            | Women's fashion
       5         |      2            | Rock music 
       6         |      3            | shirts

if i passed `PreferenceID = 1` i want to get records `Fashion,Men's fashion,Women's fashion,shirts`

and if i passed `PreferenceID = 2` i want to get records  `music ,Rock music` .


* i want to get all the child values in all levels when i pass a parent id . 
 here if i passed `PreferenceID = 1` it is `Fashoin` , it has two childs , `Men's fashion`    and `Women's fashion` . `and men's fashion` is the parent value of `shirts` . 

this is the hierarchy . it is like a tree structure , and goes to N levels , please help me 


 ![enter image description here][1]


  [1]: http://i.stack.imgur.com/PinGr.png


currently i am doing is  passing `prefernceID`  and get all next level childs ,

ex :- i am passing `prefernceID = 1` and getting only `Men's fashion`    and `Women's fashion` :(


please help . thanks in advance