diff --git a/html/compte.php b/html/compte.php index a04fc707..442fec1a 100644 --- a/html/compte.php +++ b/html/compte.php @@ -23,8 +23,9 @@ if($resultat) { if(isset($_POST['user_display_name']) && isset($_POST['user_name']) && isset($_POST['user_bio']) && isset($_POST['user_pp']) && isset($_POST['user_banner'])) { $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $req = $bdd->prepare("SELECT ID FROM users WHERE username = :user_name"); + $req = $bdd->prepare("SELECT ID FROM users WHERE username = :user_name AND ID != :user_id"); $req->bindParam(":user_name", htmlspecialchars($_POST['user_name'])); + $req->bindParam(":user_id", $_SESSION['userid']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); if($resultat) {