PHP and Database Output . Lockup during one method but not the other

Ruub

New Member
I have noticed on my little web server that if a user clicks a link while my php script is outputting data from a database that the web site seems to lock up for a while and the server log shows that "Maximum execution time of 30 seconds exceeded in" etc etc. If I create a big string and output that is does not seem to happen but im guessing it is still possible.So if I do this is seems ok:\[code\]$html_blob = '';list($result,$dbhandle,$num) = db_connect($sql);$html_blob .= 'Here is some data:<br />';while($row = mssql_fetch_array($result)) { $html_blob .= $row['first_name'].','.$row['last_name'].'<br />';}echo $html_blob;\[/code\]If I do this I can get the temporary lockup to happen if I click a link while in the while loop:\[code\]list($result,$dbhandle,$num) = db_connect($sql);echo 'Here is some data:<br />';while($row = mssql_fetch_array($result)) { echo $row['first_name'].','.$row['last_name'].'<br />';}\[/code\]Is there any recommended best practice for long (or short even) lists? Should I always concatenate a string then output that instead?
 
Back
Top