If you were talking about production code, you might need to worry about
> getting more clever with memory management... but if it's a once-and-done
> processing script, I see nothing wrong with taking the associative array
> approach in the interest of writing clean, understandable code. I think the
> easiest solution to your problem is simply to raise your PHP memory limit:
>
> http://www.ducea.com/2008/02/14/increase-php-memory-limit/
>
> Obviously this solution only works to a certain point... but if you're
> hitting a 32MB limit right now, you've probably still got a lot of room to
> grow!
>
32MB may just be a default configuration that wasn't even intentional, so
I'd just ask for a boost. If you can't get that, creating a temp table might
meet your need. I wouldn't even consider making millions of UPDATE calls.
kyle
|