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