I have tables in my mySQL database like:
+-------+------------+-------------+-----------+
| ID | subject | Predicate | object |
+-------+------------+-------------+-----------+
| 1 | ATM | subClassof | Network |
+-------+------------+-------------+-----------+
| 2 | ARPANET | subClassof | Network |
+-------+------------+-------------+-----------+
| 3 | Network | subClassof | Main |
+-------+------------+-------------+-----------+
| 5 | Software | subclassof | Main |
+-------+------------+-------------+-----------+
| 7 | Linux | subClassof | Software |
+-------+------------+-------------+-----------+
| 8 | Windows | subClassof | Software |
+-------+------------+-------------+-----------+
| 12 | XP | subClassof | Windows |
+-------+------------+-------------+-----------+
| 13 | Win7 | subClassof | Windows |
+-------+------------+-------------+-----------+
| 14 | Win8 | subClassof | Windows |
+-------+------------+-------------+-----------+
For Predicate subClassof
it will have a tree view like this:
Main
|__ Network
| |__ ATM
| |__ ARPANET
|
|__ Software
|__ Linux
|__ Windows
|__ XP
|__ Win7
|__ Win8
I want to create a form which can select the start node and get all parent for that. For example by choosing Win7
i want to get:
main, Software, Windows,
Win7
Step2: is there any way to print this nodes with a simple text like this:
Main
|__ Software
|__ Windows
|__ Win7