使用PHP变量值INSERT查询

I tried to insert value to table with PHP mysql command. Insert values pass as php variables. I tried

$sql = "INSERT INTO info (nom, prenom, entreprise, email, objet, message) VALUES ('$nom','$prenom','$entreprise','$email','$objet','$message')";

this way. But it not works. And also i tried with concatenation it also not working.

Thanks,

Try this.

$sql = "INSERT INTO info (nom, prenom, entreprise, email, objet, message) VALUES (
'".$nom."',
'".$prenom."',
'".$entreprise."',
'".$email."',
'".$objet."',
'".$message."'
)";

Hope this will help!

Try This

    $sql = "INSERT INTO `info` (`nom`, `prenom`, `entreprise`,`email`,`objet`,`message`) VALUES ('$nom','$prenom','$entreprise','$email','$objet','$message')";