syntax error, unexpected '$Name' (T_VARIABLE) error appears for this line
My query is-
$sql = "INSERT INTO person (Name,Email) VALUES ("$Name","$Email")";
syntax error, unexpected '$Name' (T_VARIABLE) error appears for this line
My query is-
$sql = "INSERT INTO person (Name,Email) VALUES ("$Name","$Email")";
Use single quote in value
$sql = "INSERT INTO person (Name,Email) VALUES ("$Name","$Email")";
To
$sql = "INSERT INTO person (Name,Email) VALUES ('$Name','$Email')";
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...