-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDraftPlayer.php
More file actions
27 lines (21 loc) · 762 Bytes
/
Copy pathDraftPlayer.php
File metadata and controls
27 lines (21 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once('StartSession.php');
// Proceed only for authenticated users
if (!authenticatedUser()) {
echo "You must be logged in to access this page<br/>";
require_once("logIn.html");
return;
}
// Fetch a row from the draft data
$playerID = $_POST['playerID']; // Assuming 'rowNumber' is sent via POST
echo "playerID: ".$playerID;
echo "team id: ".$_SESSION['Team'];
//UPDATE Users SET TeamID = 1 WHERE UserID = 5
// use the player ID to update the database
$query = "UPDATE Users SET TeamID = ? WHERE User_ID = ?";
$draftPlayer = $db->prepare($query);
$draftPlayer->bind_param('si', $_SESSION['Team'], $playerID);
$draftPlayer->execute();
$draftPlayer->store_result();
//return to Coach Homepage
header("Location: CoachHomepage.php");