Skip to content
Advertisement

Parent child sql table show as table in php

I have table structure like this:

Is there any way to get all relation in one line?

Like this:

Advertisement

Answer

Assuming your table has a name “htable” and as soon as there are up to FOUR (4) levels of hierarchy, it can be done like that using self join:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement