Dan McCullough wrote:
I've come into this discussion pretty late so please bear with me if I
go over something that has been ruled out.
You are trying to print out in a threaded method the first post in a
thread followed by each post after that, that is a child/reply to that
post. Is that
Thanks to everybody who posted on this thread. I wanted to post back
the solution I came up with after removing the DB query from the
recursion. In case anyone else is trying to accomplish the same thing,
this is how I solved it (criticisms welcome, and note that I have not
tested it extensively
Ben Liu wrote:
Thanks to everybody who posted on this thread. I wanted to post back
the solution I came up with after removing the DB query from the
recursion. In case anyone else is trying to accomplish the same thing,
this is how I solved it (criticisms welcome, and note that I have not
tested
On 6/30/06, Adam Zey [EMAIL PROTECTED] wrote:
I think that will work, but there is one huge improvement you can make.
You are making millions of copies of your work array! Not only do you
pass the entire array by value recursively, but foreach makes copies of
the arrays it loops through! So who
Ben Liu wrote:
The second thing to do is to make the foreach work
on references instead of copies. I actually think that since what we
have in our function is now a reference, the foreach WILL NOT copy it.
Anyone have any ideas on this? Is the foreach loop in fact copying
$workArr? And how
On Jun 30, 2006, at 5:04 PM, Adam Zey wrote:
I mean, do this:
foreach ( array_keys($workArr) as $key ) {
echo $workArr[$key]['foo'];
}
instead of this:
foreach ( $workArr as $key = $value ) {
echo $value['foo'];
}
Okay, I think I get the idea.
So using my code example...
Hello,
As Adam pointed out, this can be deadly to your database, especially as the
number of posts grows. If you want to go that route, I would recommend
selecting all the posts in that particular thread and sorting the data out
in PHP somehow. No need to slam your database with (potentially)
I've come into this discussion pretty late so please bear with me if I
go over something that has been ruled out.
You are trying to print out in a threaded method the first post in a
thread followed by each post after that, that is a child/reply to that
post. Is that correct?
So something like
8 matches
Mail list logo