in reply to Clean Code - What a mess...
Maybe you're actually bloating the cache that's created when you use $database->prepare_cached(). I suppose that would depend on how many lines of input this script sees.
I wonder why you would even want to cache the results of SQL statements such as CREATE TABLE IF NOT EXISTS. Does this help? I would have guessed that the cache was more useful more SELECT queries.
Anyway, as a longshot, try turning those into $database->prepare() instead, and see if it helps any.
Even better, substitute placeholders for the variables. That way you can prepare() the statements once and execute() them with the correct parameters each timne through the loop. It may not affect the memory leak, but it's useful in many ways.
buckaduck
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Clean Code - What a mess...
by PyroX (Pilgrim) on Nov 29, 2001 at 04:20 UTC | |
by runrig (Abbot) on Nov 29, 2001 at 04:31 UTC |