prepare("SELECT COUNT(pseudo) AS check FROM login WHERE pseudo = :pseudo LIMIT 1"); //$requete->bindValue(":pseudo", $pseudo); //$requete->execute(); //$output = $requete->fetch(); $requete = $bdd->query("SELECT pseudo FROM login WHERE pseudo = '$pseudo'"); $count = $requete->rowCount(); if($count != 1) { $requete = $bdd->prepare("INSERT INTO login (pseudo, prenom, nom, mdp) VALUES (:pseudo, :prenom, :nom, :mdp)"); $requete->bindParam(":pseudo", $pseudo); $requete->bindParam(":prenom", $firstname); $requete->bindParam(":nom", $lastname); $requete->bindParam(":mdp", $pass); $requete->execute(); $reponse = "v"; } else { $reponse = "i"; } } else { $reponse = "u"; } } echo json_encode($reponse);