I'm not sure how to pass the value of $tid to another php file. Well, I do know how but the thing is I want to have the button store the current $tid since it's gonna change after the next loop. If I use sessions and just call it from another file, $tid's value will be that of the last iteration.
$select = mysqli_query($conn, "SELECT Sport, TeamID, TeamAcadYear FROM team");
echo "<html> <body> <table align='center'>";
while($row = mysqli_fetch_array($select)){
$sportName = $row['Sport'];
$tay = $row['TeamAcadYear'];
$tid = $row['TeamID'];
echo " <tr> <td> <button type='button'> $sportName" ." " ."$tay </button> </td> </tr>";
}
echo "</table> </body> </html>";