Code: Select all
child_id | parent_id
22 | 0
23 | 0
24 | 22
25 | 24
26 | 0
27 | 26Code: Select all
25
24
22I'm assuming this is going to be an inner join I'm just not sure how to recursively do it with mysql.
I can create a loop w/ php to do this however; I'd like to see if this can be done in a single query.