I have used the following code to display fixtures for a prediction league into a table but unfortunately it is not displaying all fixtures, just one fixture for a date instead of say for example five. :
$db = mysql_connect($dbaseHost,$dbaseUsername,$dbasePassword);
mysql_select_db($dbaseName ,$db);
$query = "SELECT matchid, DATE_FORMAT(matchdate,'%Y-%m-%d'), hometeam, awayteam, homescore, awayscore FROM plmatchdata
WHERE MONTH(matchdate) = $month
ORDER by 'matchdate' ASC";
$result = mysql_query($query,$db) or die (mysql_error());
$num_rows = mysql_num_rows($result);
?>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" class="TBLROW">
<tr>
<td colspan="7">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="TBLROW">
<tr >
<td colspan="2" align="left" class="TBLROW">
<?
$previous_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=";
if($month == 1){
$previous_link .= mktime(0,0,0,12,$day,($year -1));
} else {
$previous_link .= mktime(0,0,0,($month -1),$day,$year);
}
$previous_link .= "\">« Prev</a>";
echo $previous_link
?>
</td>
<td class="TBLROW" colspan="3" align="center">
<b><?echo $month_name;?> <?echo $year?></b>
</td>
<td colspan="2" align="right" class="TBLROW" >
<?
$next_link = "<a href=\"".$_SERVER['PHP_SELF']."?date=";
if($month == 12){
$next_link .= mktime(0,0,0,1,$day,($year + 1));
} else {
$next_link .= mktime(0,0,0,($month +1),$day,$year);
}
$next_link .= "\">Next »</a>";
echo $next_link;
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="dayheader">S</td>
<td class="dayheader">M</td>
<td class="dayheader">T</td>
<td class="dayheader">W</td>
<td class="dayheader">T</td>
<td class="dayheader">F</td>
<td class="dayheader">S</td>
</tr>
<?
while ($row = @mysql_fetch_array($result, MYSQL_BOTH))
{
$matchid=$row["matchid"];
$hometeam=$row["hometeam"];
$awayteam=$row["awayteam"];
$homescore=$row["homescore"];
$awayscore=$row["awayscore"];
$fixdate=$row[1];
$db_array[$fixdate] = array('matchid' => $matchid, 'fixdate' => $fixdate, 'hometeam' => $hometeam, 'awayteam' => $awayteam, 'homescore' => $homescore, 'awayscore' => $awayscore);
}
$i = 0;
foreach($weeks AS $week){
echo "<tr>\n";
foreach($week as $d){
if($i < $offset_count){
echo "<td class=\"nonmonthdays\">\n";
echo suffix($d);
echo "</td>\n";
}
// Displays Today's Matches
if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset)){
if($date == mktime(0,0,0,$month,$d,$year)){
echo "<td class=\"today\">";
echo suffix($d)."<br>";
$cdate = date("Y-m-d",mktime(0,0,0,$month,$d,$year));
if(isset($db_array[$cdate]['fixdate'])) {
echo"<a href=\"#\" onMouseover=\"window.status='";
echo $db_array[$cdate]['hometeam']." ".$db_array[$cdate]['homescore']." vs ".$db_array[$cdate]['awayscore']." ".$db_array[$cdate]['awayteam'];
echo "'; return true\">Match Info</a>";
}
echo "</td>\n";
} else {
echo "<td valign=\"top\" height=\"80px\" class=\"days\">\n";
echo suffix($d)."<br>";
$cdate = date("Y-m-d",mktime(0,0,0,$month,$d,$year));
if(isset($db_array[$cdate]['fixdate'])) {
echo"<a href=\"#\" onMouseover=\"window.status='";
echo $db_array[$cdate]['hometeam']." ".$db_array[$cdate]['homescore']." vs ".$db_array[$cdate]['awayscore']." ".$db_array[$cdate]['awayteam'];
echo "'; return true\">Match Info</a>";
}
echo "<br>";
echo "<br></td>\n";
}
} elseif(($outset > 0)) {
if(($i >= ($num_weeks * 7) - $outset)){
echo "<td class=\"nonmonthdays\">\n";
echo suffix($d);
echo "</td>\n";
}
}
$i++;
}
echo "</tr>\n";
}
?>
</table>
but I seem to be limited to displaying one match per date. As far as Im aware I have limited it to one display per date, does it have something to do with the array? Please can somebody help me.