Shannon,

Try changing your last 'elseif' to an 'else'. It could be hanging on the
else-if syntax.

Rich
----- Original Message -----
From: "Shannon Doyle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 03, 2001 6:27 AM
Subject: [PHP-DB] Some assistance please


> 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";
> }
> }
> ?>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to