Hi People,

Below I have included some code that just doesn't seem to be functioning all
correctly. I have this running and it appears to stop the query/echo after
the first entry in the database. What is it that I am doing wrong here??


$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);
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

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