your problem correctly, a parent will be read from the database and as
it will not be 0, the function will enter the else statement.
There is will add the parent ID to the array and then pass this array
plus the parent ID via a recursive call to the function.
In the (recursive) function a parent will be read and it will be 0,
thus entering into the main if statement, where the array is reversed,
and returned ...
... returning to the function ... ups, the returned (reversed array)
is lost in the null land, because no variable is defined to receive
id! And the $array will just contain the values as before the call
(recursive) to the function.
And furthermore, I don't see any statement returning anything from
hereon!
Please check your code !! Turn on Debug, add debug statements and try
again!
Enjoy,
John
On Jun 28, 11:53 pm, Sanfly <san...@gmail.com> wrote:
> No, I dont think so. I have no trouble building the array because
> this line:
>
> print_r($reverse); echo "<br><br>";
>
> does print the entire correct array. Its returning it from the
> function when there is more than one value in the array that gives me
> a problem.
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment