这是我的代码:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = "INSERT INTO together (`First Name`,`Last Name`, `Email id`,'Password')
VALUES ( '$_POST[First name]', '$_POST[Last name]', '$_POST[Email_id]','$_POST[Password]')";
mysql_select_db('test');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "You have successfully singed up for together \n";
mysql_close($conn);
?>
但是当我运行它时,我收到以下错误:
( Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting ']' in C:\wamp\www\MyProjects\Sign_up.php on line 11)
请帮我修复它。