$tourneyName
"; echo "$tourneyDate
"; echo "$tourneyUID
"; echo "$division
"; echo "$numPlayers
"; echo "$bestOf
"; echo "$winningTeamName
"; echo "$winningPlayer1
"; echo "$winningPlayer2
"; echo "$winningPlayer3
"; echo "$winningPlayer4
"; echo "$notes
"; $insert = $conn->prepare("UPDATE " . $tournamentDataTableName . " SET tournamentName = :tournamentName, tournamentDate = :tournamentDate, tournamentDivision = :tournamentDivision, numPlayers = :numPlayers, bestOf = :bestOf, winningTeamName = :winningTeamName, winner1 = :winner1, winner2 = :winner2, winner3 = :winner3, winner4 = :winner4, notes = :notes WHERE tournamentID = :tournamentID "); $insert->bindValue(":tournamentName", $tourneyName); $insert->bindValue(":tournamentDate", $tourneyDate); $insert->bindValue(":tournamentDivision", $division); $insert->bindValue(":numPlayers", $numPlayers); $insert->bindValue(":bestOf", $bestOf); $insert->bindValue(":winningTeamName", $winningTeamName); $insert->bindValue(":winner1", $winningPlayer1); $insert->bindValue(":winner2", $winningPlayer2); $insert->bindValue(":winner3", $winningPlayer3); $insert->bindValue(":winner4", $winningPlayer4); $insert->bindValue(":notes", $notes); $insert->bindValue(":tournamentID", $tourneyID); $insert->execute(); echo "Successfully edited tournament record"; // Function from StackOverflow used to get the base URL, to which we append // the redirect (where the user came from) function url(){ return sprintf( "%s://%s/tournament", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'] ); } $address = url(); echo "Redirecting to $address/$tourneyUID...
"; echo ""; } catch (PDOException $e) { // failed connection echo "Connection failed: " . $e->getMessage(); } $conn = null; ?>