I have the following code which links my phpmyadmin database to my PHP script. The code takes a table of 50 NFL players with their stats of the previous season. Now, I want to be able to code it so that I can select a player via a drop down box or some sort of dropdown box/list like that and then when selected and the Table is shown again, that player will not be listed. However, I am stuck and am not sure how to do this. Could someone at least help me out with the basics and what I would need for this?
<!DOCTYPE html>
<html>
<head>
<title>PHP Project</title>
<style>
table,th,td {
border: 1px solid navy;
}
</style>
</head>
<body>
<?php
$db_hostname='localhost';
$db_username='root';
$db_password='';
$db_database='Project';
$connection = new mysqli( $db_hostname,
$db_username,
$db_password,
$db_database);
if ($connection->connect_error) {
echo "Sorry";
} else {
echo "Connected!<br><br>";
$sql = "SELECT * FROM NFL2014Receiving";
$result = $connection->query($sql);
if (!$result) die ($connection->error);
$n = $result->num_rows;
for ($i=1; $i<=$n; $i++) {
$row = $result->fetch_array(MYSQLI_ASSOC);
echo "<table>
<tr><th>ID</th><th>Player</th><th>Team</th>
<th>Position</th><th>Receptions</th>
<th>Receiving Yards</th><th>Avg Yds/Catch</th>
<th>Avg Yds/Game</th><th>Touchdowns</th></tr>";
echo "<tr><td width=20>" . $row['iD'] . "</td><td width=150>" . $row['Player'] . "</td><td width=40>" .
$row['Team'] . "</td><td width=30>" . $row['Pos'] . "</td><td width=30>" .
$row['Rec'] . "</td><td width=40>" . $row['Yds'] . "</td><td width=30>" .
$row['Avg'] . "</td><td width=40>" . $row['Yds/G'] . "</td><td width=20>" .
$row['TD'] . "</td></tr>";
}
echo "</table>";
}
?>
</body>
</html>