I would like the next game to show up in <TD >Up next: (I would like it to put the next event here)</TD>
The code used to make a 2 week schedule is
<?php
$today=getdate();
//Start from Sunday
if($today[wday] > 0){
$start=mktime (0,0,0,date("m") ,date("d")-$today[wday],date("Y"));
}
//Create first week
$x = 0;
echo(' <TR valign="top" bordercolor="#000000" bgcolor="#FFFFFF">');
while ($x < 14){
if($x==7){
echo('</tr><TR valign="top" bordercolor="#000000" bgcolor="#FFFFFF">');
}
$check=date("Y-m-d",mktime (0,0,0,date("m",$start) ,date("d",$start)+$x,date("Y",$start)));
$day = date("d",mktime (0,0,0,date("m",$start) ,date("d",$start)+$x,date("Y",$start)));
$result = @mysql_query("SELECT ddate ,copp,nhome,ncon,iidgender,iidgame,nwooscore,noppscore FROM schedule WHERE iidgender=0 and iidtype=3 AND ddate='$check' ORDER BY ddate");
if (!$result) {
die('<p>Error retrieving data: ' . mysql_error() . '</p>');
}
if (mysql_num_rows($result) > 0) {
$copp = mysql_result($result,0,'copp');
$home=mysql_result($result,0,'nhome');
$con=mysql_result($result,0,'ncon');
$woo=mysql_result($result,0,'nwooscore');
$opp=mysql_result($result,0,'noppscore');
$res='';
$at='';
$b='';
$bb='';
if($woo > 0 and $opp > 0 ){
$wl='(Loss)';
if($woo > $opp){
$wl='(Win)';
}
$res=$woo.' - '.$opp.' '.$wl;
}
if(!$home ==0){
$at = ' at ';
}
if($con==1){
$b='<b>';
$bb='</b>';
}
echo('<td><div style="background-color: #ffffcc;font-weight: bold;">'."$day<br>$at$b$copp$bb<br>$res</div></td>");
}else{
echo("<td>$day<br><br></td>");
}
$x++;
}
echo('</tr');
?>
The other thing is, How do you add more database fields? Can I just take the new_data.php file that is used to enter info now and add new
$cname=$_POST['cname'];
to it? A form for enter stats is already done. I would just like to add more stats to it.
Thanks
Kevin