I have a function for getting path in a tree structure data.
According to my table in DB, root should get no result when I query sub_id='root_id'
When I just pass the root the rowCount return correct result which is 0. However when I pass a node from lower rank(3rd), in the end of the recursive which is root, rowCount return 1?
PS
I use Mysql as DB
This is my table
main_id | sub_id
----------------
1 | 2 …Run Code Online (Sandbox Code Playgroud)