as admin you now can't delete your own account

This commit is contained in:
Grisu
2022-09-22 18:09:50 +02:00
parent dc4d28cd91
commit c1ffddfdb2
2 changed files with 17 additions and 2 deletions

View File

@@ -529,4 +529,16 @@ function get_result_team_station($con, $s_id, $m_id) {
} catch( PDOException $e) {
handle_pdo_exception($e);
}
}
function get_id_user_by_user_id($con, $user_id) {
try {
$stmt = $con->prepare("SELECT * FROM users WHERE user_id = ?");
$stmt->bindParam(1, $user_id, PDO::PARAM_STR);
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
return $stmt->fetch()['id'];
} catch( PDOException $e) {
handle_pdo_exception($e);
}
}