Hello, the first time I come across such a sample. In general, there is such a user
table.
id
- userid
name
- usernameparent_id
- link to parent record ID
I need to pull out from the database all users whose parent_id
is equal to the current user id
.
Then where parent_id
is equal to their id
and so endlessly until the chain ends. How to do it better?