Fix: delete player - delete records of player
This commit is contained in:
@@ -8,6 +8,11 @@ $maestroID = $_POST["maestro_id"];
|
||||
$playerID = $_POST["player_id"];
|
||||
|
||||
|
||||
deleteAppHighestRecord($maestroID, $playerID);
|
||||
deleteBestRecord($maestroID, $playerID);
|
||||
deleteLicenseScore($maestroID, $playerID);
|
||||
deleteLicenseTime($maestroID, $playerID);
|
||||
|
||||
deletePlayer($maestroID, $playerID);
|
||||
|
||||
$countPlayer = countPlayerID($maestroID, $playerID);
|
||||
@@ -33,7 +38,21 @@ send_result_success();
|
||||
exit;
|
||||
|
||||
|
||||
function deletePlayer($maestroID, $playerID) {
|
||||
|
||||
function deleteAppHighestRecord($maestroID, $playerID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
DELETE FROM app_highest_record
|
||||
WHERE MaestroID = ? AND PlayerID = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||
$result = $stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
function deleteBestRecord($maestroID, $playerID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -44,10 +63,36 @@ function deletePlayer($maestroID, $playerID) {
|
||||
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||
$result = $stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
// if($result) {
|
||||
// echo "deleted row count : ".$stmt->affected_rows;
|
||||
// }
|
||||
function deleteLicenseScore($maestroID, $playerID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
DELETE FROM license_score
|
||||
WHERE MaestroID = ? AND PlayerID = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||
$result = $stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
function deleteLicenseTime($maestroID, $playerID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
DELETE FROM license_time
|
||||
WHERE MaestroID = ? AND PlayerID = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("ii", $maestroID, $playerID);
|
||||
$result = $stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
function deletePlayer($maestroID, $playerID) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
DELETE FROM player
|
||||
|
||||
Reference in New Issue
Block a user