delete entries in statistic

This commit is contained in:
2022-06-18 10:27:58 +02:00
parent 3bea28c125
commit fe877ea176
3 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
session_start();
include("../scripts/connection.php");
include("../scripts/functions.php");
$user_data = check_login($con);
if($_SERVER['REQUEST_METHOD'] == "POST") {
try {
$stmt = $con->prepare("DELETE FROM Punkte WHERE m_id = ? AND s_id = ?");
$stmt->bindParam(1, $_POST["m_id"], PDO::PARAM_INT);
$stmt->bindParam(2, $_POST["s_id"], PDO::PARAM_INT);
$stmt->execute();
} catch(PDOException $e) {
handle_pdo_exception($e);
}
}
$con = null;
header("Location: statistik.php");
die;
?>