|
Posted by Toby A Inkster on 02/05/07 09:48
Eric Layman wrote:
> [Open Connection]
> [declare 2D array]
> [loop thru recordset]
> [2D array] = [data]
> [recordset.close]
> [end loop]
> [Close connection]
After this, all your data is now stored in $2dArray, using up memory. If
you loop through the recordset, reading one line at a time and outputting,
you use less memory. For small bits of data, that's unlikely to be a
problem though.
By the way, you may want to put more consideration into your message
subject lines in future. "!Need advice from other PHP developers." could
easily apply to 90% of the messages to this group. A more specific subject
line which may help clue readers in to what your post will be about would
have been "Caching SQL results into an array" or somesuch.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|