I have these two tables in my database. 'Members' contains member id and names of memebers and 'Network' contains member_id and the id of members at their first, second and first place.
I want to create a loop where I will be putting member id and the loop will give me all his downline members with ids and their network. The expect result is attached here with.
If you have any other idea to do that, the idea is welcome. Thank you very much in advance.