While inserting data from a form into a database i am getting error in the below code only. The error displayed is :( ! ) Parse error: syntax error, unexpected '' (T_ENCAPSED_AND _WHITESPACE), expecting ']'
what does the displayed error mean? what is the possible solution?
Code:
$sql= "INSERT INTO Persons (FirstName,LastName,Age) VALUES('$_POST[FirstName ]','$_POST[LastName]','$_POST[Age]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?>
Comment