|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2002-09-05 15:28 UTC] georg@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Wed Oct 22 16:00:01 2025 UTC | 
I am running PHP 4.2.2, Apache 2.0.3.9, and MySQL 4.0.1-alpha-nt I am using the following code to insert rows in to a html table: ######START CODE###### db_connect(); $result = mysql_query("SELECT * FROM db ORDER BY title"); if ($result) { for($movies=0; $sts_tmp = mysql_fetch_row($result); ++$movies) { if($movies % 2 == 0) { $bgcolor="#CCCCCC"; }else{ $bgcolor="#DDDDDD"; } echo " <TR>\n"; for($x=0;$x<6;++$x) print " <TD BGCOLOR='$bgcolor'>$sts_tmp[$x]</TD>\n"; echo " <TD BGCOLOR='$bgcolor'><INPUT TYPE='BUTTON' VALUE='Delete' ONCLICK=\"JavaScript:document.location='movie.php?action=delete&title=$sts_tmp[0]'\"></TD>\n" . " </TR>\n\n"; } echo "<TR><TD COLSPAN='7'><B>Total Movies: " . mysql_num_rows($result) . "</B></TD></TR>\n"; mysql_free_result($result); } db_close(); ######END CODE###### Most of the time the script runs fine, but every other third time or so extra garbage code appears in with the normal output. Garbage Code: <TR> <TD BGCOLOR='#DDDDDD'>Mallrats</TD> <TD BGCOLOR='#DDDDDD'>0</TD> <TD BGCOLOR='#DDDDDD'>0</TD> <TD BGCOLOR='#DDDDDD'>0</TD> ??S???S? BGCO @o?'#DDDDDD'>CD</TD> <TD BGCOLOR='#DDDDDD'></TD> <TD BGCOLOR='#DDDDDD'><INPUT TYPE='BUTTON' VALUE='Delete' ONCLICK='JavaScript:document.location="movie.php?action=delete&title=Mallrats"'></TD> </TR>