<?php
$dbhost = "localhost";
$dbusername = "sleyland";
$dbpassword = "GH78By";
$database = "sleyland";
mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($database);
$query = "SELECT id, game, opposition, venue FROM fixtures";
$result = mysql_query($query) or die(mysql_error());
echo $query;
echo '<table width="100%" border="1" cellpadding="0">';
echo '<tr>';
echo '<td width="20%" align="center" bgcolor="FFFFFF">';
echo 'Date';
echo '</td>';
echo '<td width="40%" align="center" bgcolor="FFFFFF">';
echo 'Opposition';
echo '</td>';
echo '<td width="20%" align="center" bgcolor="FFFFFF">';
echo 'Home/away';
echo '</td>';
echo '<td width="20%" align="center" bgcolor="FFFFFF">';
echo 'Score';
echo '</td>';
echo '</tr>';
while ($query_data = mysql_fetch_row($result))
{
$id = $query_data[0];
$date = $query_data[1];
$opposition = $query_data[2];
$venue = $query_data[3];
$result = $query_data[4];
echo '<tr>';
echo '<td width="25%" bgcolor="FFFFFF">';
echo $date;
echo '</td>';
echo '<td width="25%" bgcolor="FFFFFF">';
echo $opposition;
echo '</td>';
echo '<td width="25%" bgcolor="FFFFFF">';
echo $venue;
echo '</td>';
echo '<td width="25%" bgcolor="FFFFFF">';
echo $result;
echo '</td>';
echo '</tr>';
}
echo '</td>';
echo '</tr>';
echo '</table>';
?>
You have this in there twice:
$query = "SELECT id, game, opposition, venue FROM fixtures";
$result_= mysql_query($query) or die(mysql_error());
Get rid of the second one, like I have and give that a shot... There is no need to redifine the query, and it may be wreaking havoc... Also get rid of the underscore after the $result part in the one you keep.
Also, your select statement is only querying 4 items, but your array contains 5... You may want to check that too...