Some assistance please

From: Date: Tue, 03 Apr 2001 11:27:17 +0000
Subject: Some assistance please
Groups: php.db 
Request: Send a blank email to php-db+get-8175@lists.php.net to get a copy of this message
Hi People, I have a sql query running an array'd result that should echo a different result depending on the result of the query. However, it successfully does one of the entries from the query, but then appears to stop. With no further results displayed. Could someone take a look at the code at the bottom of this email and see if they can determine why it is not continuing through the rest of the results. Thanks in advance - Shannon <? $roundnum = ""; $sql = "select * from results order by round"; $dbh = @mysql_connect($dbhost,$dbuser,$dbpass); $results = mysql_db_query($db,$sql,$dbh); for($i = 0; $i < mysql_num_rows($results); $i++) { $array[$i] = mysql_fetch_array($results); } mysql_close($dbh); for ($i = 0; $i < count($array); $i++) { if ($array[$i]["round"] != $roundnum) { $roundnum = $array[$i]["round"]; echo "<tr><td colspan='5'><br><p align='center'><b><font color='#990000'>Round ".$roundnum."</font></b></p></td></tr>"; echo "<tr><td width='100'><p>".$array[$i]["home"]."</p></td><td width='10'><p>".$array[$i]["home_goals"]."</p></td><td width='50'>\n"; if ($array[$i]["home_goals"] > $array[$i]["away_goals"]) { echo "<p>Defeated</p></td>"; } elseif ($array[$i]["home_goals"] < $array[$i]["away_goals"]) { echo "<p>Defeated by</p></td>"; } elseif ($array[$i]["home_goals"] == $array[$i]["away_goals"]) { echo "<p>Drew</p></td>"; } echo "<td width='100'><p>".$array[$i]["away"]."</p></td><td width='10'><p>".$array[$i]["away_goals"]."</p></td>\n"; } } ?>

« previous php.db (#8175) next »