Posted by Petr Vileta on 02/06/07 05:18
"Eric Layman" <erricson@lays> píše v diskusním příspěvku
news:1170652022_7441@sp6iad.superfeed.net...
> Hi,
>
> Many years ago when I first learnt abt web dev in school,
>
> I was taught this methodology:
>
> [Open connection]
> <html>
> blah blabh
> [execute sql]
> [loop thru recordset]
> <table>[data] </table>
> [recordset close]
> [end loop]
> <html>
> [Close connection]
>
> Over the peroid of time, I noticed that the above method may cause
> connection problems on heavy sites.
>
> Recently, I have use another method to retrieve data from server
>
> [Open Connection]
> [declare 2D array]
> [loop thru recordset]
> [2D array] = [data]
> [recordset.close]
> [end loop]
> [Close connection]
> <html>
> [loop thru the 2D array]
> <table>[2d array's DATA] </table>
> [end array loop]
> </html>
If you can read say tens or hundreds of records then the first method is
better. Not oveload server memory and is quickly.
But if you can read thousand or more records then is better to use other
methods.
[open connection]
[open temporary file]
[loop thru recordset]
[write to file]
[end loop]
[close connection]
[close file]
[open file]
[loop thru lines]
[print to html]
[end loop]
[close file]
By my experience all servers have less RAM then disk space ;-) and read or
write text file is a simple task for server.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
[Back to original message]
|