1

How do I print the name of the parent id to child id like this?

Computer

Computer->Laptop

Computer->Laptop->Sony

Computer->Laptop->Apple

Computer->Laptop->Apple->Macbook Pro

Computer->Laptop->Apple->Macbook Air


[0] => stdClass Object
    (
        [id] => 75
        [pid] => 0
        [nama] => Computer
        [deskripsi] => All About Computer
        [status] => 1
        [keyword] => computer,pc,personal pc
        [tag] => computer,pc,personal pc
        [imgurl] => 
        [bahasa] => en
        [posisi] => 0
    )

[1] => stdClass Object
    (
        [id] => 76
        [pid] => 75
        [nama] => Laptop
        [deskripsi] => All About Laptop Various Brands
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 1
    )

[2] => stdClass Object
    (
        [id] => 82
        [pid] => 76
        [nama] => Sony
        [deskripsi] => All product Sony Laptop
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 2
    )

[3] => stdClass Object
    (
        [id] => 77
        [pid] => 76
        [nama] => Apple
        [deskripsi] => All About Apple Product
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 3
    )

[4] => stdClass Object
    (
        [id] => 78
        [pid] => 77
        [nama] => Macbook Pro
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 4
    )

[5] => stdClass Object
    (
        [id] => 79
        [pid] => 78
        [nama] => Retina Display
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 5
    )

[6] => stdClass Object
    (
        [id] => 81
        [pid] => 77
        [nama] => Macbook Air
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 6
    )

[7] => stdClass Object
    (
        [id] => 83
        [pid] => 76
        [nama] => Leonovo
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] =>
        [bahasa] => en
        [posisi] => 7
    )

[8] => stdClass Object
    (
        [id] => 80
        [pid] => 0
        [nama] => Perlengkapan
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 8
    )

[9] => stdClass Object
    (
        [id] => 84
        [pid] => 80
        [nama] => Processor
        [deskripsi] => 
        [status] => 1
        [keyword] => 
        [tag] => 
        [imgurl] => 
        [bahasa] => en
        [posisi] => 9
    )
Charles
  • 50,943
  • 13
  • 104
  • 142
afiszone
  • 11
  • 1
  • Yes, i have alrady tried, this my code. – afiszone Jan 29 '14 at 11:48
  • What is your code? Please post it here... – BenM Jan 29 '14 at 11:50
  • @user2936213, when making formatting corrections, please also correct spelling and grammatical errors. Suggested edits that fix *all* of the problems in a post are more likely to be approved. Formatting-only changes are discouraged and tend to get rejected. Too many rejected edits will block your ability to edit. – Charles Jan 31 '14 at 04:56
  • ok i will remember this for next time :) – user2936213 Jan 31 '14 at 04:58

0 Answers0