Update file compte.php

This commit is contained in:
Jan BELLON 2024-03-11 22:31:46 +00:00
parent 7971cf0e99
commit 4f6b80fb03

View File

@ -25,7 +25,7 @@ if(isset($_POST['user_display_name']) && isset($_POST['user_name']) && isset($_P
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
$req = $bdd->prepare("SELECT ID FROM users WHERE username = :user_name AND NOT ID = :user_id"); $req = $bdd->prepare("SELECT ID FROM users WHERE username = :user_name AND NOT ID = :user_id");
$req->bindParam(":user_name", htmlspecialchars($_POST['user_name'])); $req->bindParam(":user_name", htmlspecialchars($_POST['user_name']));
$req->bindParam(":user_id", $_SESSION['userid']); $req->bindParam(":user_id", $_SESSION['userid'], PDO::PARAM_INT);
$req->execute(); $req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC); $resultat = $req->fetchAll(PDO::FETCH_ASSOC);
if($resultat) { if($resultat) {