I'm trying to insert values in the contents table. It works fine if I do not have a PHP variable inside VALUES. When I put the variable $address inside VALUES then this doesn't work
$lat= $_GET['lat']; //latitude
$lng= $_GET['lng']; //longitude
$address= $_GET['nom']; // this is an exmple
// $address= getAddress($lat,$lng); real fonction my probleme is how to call $address in values
$bdd->exec('INSERT INTO user(nom, prenom, Gsm, Email, Sexe, address) VALUES(\''.$_GET['nom'].'\' , \''.$_GET['prenom'].'\' , \''.$_GET['mobile'].'\' , \''.$_GET['Nemail'].'\' , \''.$_GET['sexe'].'\', '$address' )');
'.$address.'would fix that. You forgot the dot to do string concatentation. But it would still leave your code wide open to hacking, and also prone to SQL syntax errors if people put such wild and crazy things as, for example, quote marks in the input. The answer provided is definitely the way to go.