语法错误,意外'$ Name'(T_VARIABLE)[重复]

This question already has an answer here:

syntax error, unexpected '$Name' (T_VARIABLE) error appears for this line

My query is-

$sql = "INSERT INTO person (Name,Email) VALUES ("$Name","$Email")";
</div>

You cannot use quote chars like that, the second one would terminate the string you define. Instead try using different types of quotes. That allows to actually have a quote character inside your defined string.

Take a look at this modified and working version:

$sql = "INSERT INTO person (Name, Email) VALUES ('$Name', '$Email')";

Be aware however that such creation of a sql statement smells very much of sql injection attack vulnerability...

Use single quote in value

$sql = "INSERT INTO person (Name,Email) VALUES ("$Name","$Email")";

To

$sql = "INSERT INTO person (Name,Email) VALUES ('$Name','$Email')";