I have a MySQL table with 3 columns *ID, Item_ID, Dependency*
I want to know the best way to recursively check through the dependencies for example say i am checking for Item_ID 3's dependencies and it requires Item_ID 2 i would then need to check the dependencies for Item_ID 2
What is the best way to achieve this with PHP?
ID | Item_ID | Dependency |
---+---------+------------+
1 | 3 | 2 |
---+---------+------------+
2 | 2 | 4 |
---+---------+------------+
3 | 2 | 5 |
---+---------+------------+