NCAA College Football Schedule


[insert_php]
include(‘db/slbdbmysqli.php’);

$tm=mysqli_real_escape_string($dbh1,$_GET[‘team’]);
$yr=mysqli_real_escape_string($dbh1,$_GET[‘yr’]);
$season = $yr.’-06-01′;
$seasonend=($yr+1).’-06-01′;
echo ‘




Year:     Team:         

‘;

if(!isset($_GET[‘team’]) && (!isset($_GET[‘yr’]))){
$sql = “SELECT * from scoreboard where league like ‘NCAA Foot%’ and date > ‘2018-06-01’ and date < '2019-06-01' and (home_team like 'Purdue' or away_team like 'Purdue') order by date asc";} elseif(($yr=='All') && $tm!='All') { $sql = "SELECT * from scoreboard where league like 'NCAA Foot%' and (home_team like '$tm' or away_team like '$tm') order by date asc"; } else{ $sql = "SELECT * from scoreboard where league like 'NCAA Foot%' and date > ‘$season’ and date < '$seasonend' and (home_team like '$tm' or away_team like '$tm') order by date asc"; } $result=mysqli_query($dbh1,$sql); if($result = mysqli_query($dbh1, $sql)){ if(mysqli_num_rows($result) > 0){

echo ‘

Schedule:

‘;
$f1 = 1;
while($row = mysqli_fetch_array($result)){

$f2=$row[‘date’];
$f3=$row[‘away_team’];
$f4=$row[‘away_score’];
$f5=$row[‘home_team’];
$f6=$row[‘home_score’];
$f7=$row[‘game_status’];
$gameid=$row[‘game_id’];
if(($f6>$f4) && ($f5==$tm)) {
$f8=’W’;
$f9=($f6-$f4);
}
elseif(($f4>$f6) && ($f3==$tm)) {
$f8=’W’;
$f9=($f4-$f6);}
elseif(($f4==0) && ($f6==0)) {
$f8=’-‘;
$f9=’-‘;}
else{
$f8=’L’;
$f9=’-‘.abs($f6-$f4);}

if ($f3!=$tm)
{ $f3=’‘.$f3.’‘;
}

if ($f5!=$tm)
{
$f5=’‘.$f5.’‘;
}

$f7=’‘.$f7.’‘;
echo ‘

‘;
$i++;
}

echo “

Game Date Away Team Away Score Home Team Home Score Game Status Result Margin
‘; echo $f1; $f1++; echo ‘ ‘; echo $f2; echo ‘ ‘; echo $f3; echo ‘ ‘; echo $f4; echo ‘ ‘; echo $f5; echo ‘ ‘; echo $f6; echo ‘ ‘; echo $f7; echo ‘ ‘; echo $f8; echo ‘ ‘; echo $f9; echo ‘

“;
// Close result set
mysqli_free_result($result);
} else{
echo “No records matching your query were found.”;
}
} else{
echo “ERROR: Could not execute $sql. ” . mysqli_error($link);
}

[/insert_php]