Here is connect.php with the db info blanked out
<?php
function connectDB()
{
$hostname='***************';
$username='***********';
$password='**************';
$dbname='************';
mysql_connect($hostname, $username, $password) OR DIE('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
}
?>
And utility.php
<?php
function showerror()
{
die("Error " . mysql_errno() . " : " . mysql_error());
}
function insertAthlete($Type,$WeightClass,$LastName,$FirstName,$GradYear,$Wins,$Losses,$School)
{
mysql_query("INSERT INTO athlete VALUES (DEFAULT,'$Type','$WeightClass','$LastName','$FirstName','$GradYear','$Wins','$Losses','$School')");
}
function getAthletesAll()
{
$sql="SELECT * from athlete";
$resultAthletes = mysql_query($sql);
return $resultAthletes;
}
function getAthletes()
{
$sql="SELECT athleteType, weightClass, firstName, lastName, gradYear, wins, losses from athlete";
$resultAthletes = mysql_query($sql);
return $resultAthletes;
}
function getAthleteTypes()
{
$sql="SELECT * from athleteType";
$resultAthleteTypes = mysql_query($sql);
return $resultAthleteTypes;
}
function getSchools()
{
$sql="SELECT schoolName from school";
$resultSchools = mysql_query($sql);
return $resultSchools;
}
function displayAthletes($resultAthletes)
{
// Start a table, with column headers
print "<style>
table,th,td
{
font-family:Arial;
font-size:16;
color:#000066;
border:1px solid black;
border-collapse:collapse;
}
</style>";
print "\n<table style=width:950px>\n<tr>\n" .
"\n\t<th>Athlete ID</th>" .
"\n\t<th>Athlete Type</th>" .
"\n\t<th>Weight Class</th>" .
"\n\t<th>First Name</th>" .
"\n\t<th>Last Name</th>" .
"\n\t<th>Grad Year</th>" .
"\n\t<th>Wins</th>" .
"\n\t<th>Losses</th>" .
"\n\t<th>SchoolID</th>" .
"\n</tr>";
// Until there are no rows in the result set, fetch a row into
// the $row array and ...
while ($row = @ mysql_fetch_row($resultAthletes))
{
// ... start a TABLE row ...
print "\n<tr>";
// ... and print out each of the attributes in that row as a separate TD (Table Data).
foreach($row as $data)
print "\n\t<td> {$data} </td>";
// Finish the row
print "\n</tr>";
}
// Then, finish the table
print "\n</table>\n";
}
?>