Oh, and Ive set my debug to 2 and dont get any errors The problem is not building the array, the problem is returning the built array
On Jun 29, 9:04 pm, John Andersen <[email protected]> wrote: > Assuming you are passing anarraywith one ID, then if I understand > your problem correctly, a parent will be read from the database and as > it will not be 0, thefunctionwill enter the else statement. > > There is will add the parent ID to thearrayand then pass thisarray > plus the parent ID via a recursive call to thefunction. > > In the (recursive)functiona parent will be read and it will be 0, > thus entering into the main if statement, where thearrayis reversed, > and returned ... > > ... returning to thefunction... ups, the returned (reversedarray) > is lost in the null land, because no variable is defined to receive > id! And the $arraywill just contain the values as before the call > (recursive) to thefunction. > > 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 <[email protected]> wrote: > > > No, I dont think so. I have no trouble building thearraybecause > > this line: > > > print_r($reverse); echo "<br><br>"; > > > does print the entire correctarray. Its returning it from the > >functionwhen there is more than one value in thearraythat 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
