I have this small function which might insert users into the database. I'm using PDO and bindValue. Without the binding all works, in this way the connection with the database starts but the query does nothing. Where is the problem with my code?
// [INSERIMENTO] Aggiunge i nuovi dati al database
function inserisciUtente($idFacebook,$nome,$cognome){
$QUERY="INSERT INTO giocatore(id, nome, cognome, foto)
VALUE(:id, :nome, :cognome, :foto)";
try{
$dbh=db_connect();
$stmt=$dbh->prepare($QUERY);
$stmt->bindValue(':id', $idFacebook, PDO::PARAM_INT);
$stmt->bindValue(':nome', $nome, PDO::PARAM_STR, 32);
$stmt->bindValue(':cognome', $cognome, PDO::PARAM_STR, 32);
$stmt->bindValue(':foto', "https://graph.facebook.com/".$idFacebook."/picture?width=50&height=50", PDO::PARAM_STR, 256);
$stmt->execute();
$dbh=null;
}
catch(PDOException $e){
echo $e->getMessage();
}
}