Debug php recursion
Posted: Mon Apr 23, 2007 5:53 am
Ok i'm just curious to understand the problem.
Here i have described the db and function source.
Hi all i have found a bug in my db class when i use the recursion.
I try to use the adjacency list model to develop a three menu but
when i call the function in recursive way i loose data because
the value returned from the fetch seem to be empty.
I have db table like this:
table catalog
ID | Name_Category | Subcategory
1 node category 0
2 1_sub_category 1
3 2_sub_category 1
4 another_node 0
5 another_node 0
I have this db class code:
http://phpfi.com/229087
And i create an instance of such class with this code.
http://phpfi.com/229088
My problem is that i take only the fist main category, the subcategory of this node and later the function esc and doesn't print the other main category.
I have try to use the native php mysql function and the code work
then the problem is in my class.
Who can help me ?
Thanks in advance.
Here i have described the db and function source.
Hi all i have found a bug in my db class when i use the recursion.
I try to use the adjacency list model to develop a three menu but
when i call the function in recursive way i loose data because
the value returned from the fetch seem to be empty.
I have db table like this:
table catalog
ID | Name_Category | Subcategory
1 node category 0
2 1_sub_category 1
3 2_sub_category 1
4 another_node 0
5 another_node 0
I have this db class code:
http://phpfi.com/229087
And i create an instance of such class with this code.
http://phpfi.com/229088
My problem is that i take only the fist main category, the subcategory of this node and later the function esc and doesn't print the other main category.
I have try to use the native php mysql function and the code work
then the problem is in my class.
Who can help me ?
Thanks in advance.