Thank you guys.. Im now trying to include data from mysql database into the td cells for the days in the selected month.
This is my query:
include_once ('../connection.php');
$result = mysql_query("SELECT * FROM season_fixtures
where date >= '$year-$month-01'
and date <= '$year-$month-31'
ORDER BY date ASC",$db) or die (mysql_error());
I did it like this to reduce the amount of results, hopefully reduces server load.
<?
$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";
}
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);
if($fixdate == date("Y-m-d",mktime(0,0,0,$month,$d,$year))){
echo $opposition;
}
echo "</td>\n";
} else {
echo "<td class=\"days\">\n";
echo suffix($d);
if($fixdate == date("Y-m-d",mktime(0,0,0,$month,$d,$year))){
echo $opposition;
}
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";
}
?>
I have the following snippets of code, but where ever I put them I get a parse error of somekind or error (even when to my knowledge there is no problem with the code).
if ($row = @mysql_fetch_array($result)) {
do {
$fixid=$row["fixid"];
$opposition=$row["opposition"];
$competition=$row["competition"];
$kickoff=$row["kickoff"];
$fixdate=$row["date"];
$venue=$row["venue"];
// End the database pull
} while ($row = mysql_fetch_array($result));
}
again if anyone can help me out, i'd be most grateful!!