Friday, 24 June 2016

Parse error: syntax error, unexpected '$connection' (T_VARIABLE) in C:xampphtdocsfinalnewmail.php on line 7

When I run this code:




$reuser = $_GET['ruser'];

$mail = $_GET['msg'];
$sender = $_GET['senderr']

$connection = mysql_connect("localhost","root");
mysql_select_db("final");

if(!$connection){
die('could not connect:'.mysql_error());
}


$sql = "INSERT INTO mails (sender,to,message,)
VALUES ('$sender','$reuser','$mail')";

mysql_query($sql) or die("error".mysql_error());
mysql_close($connection);
?>


I get this error:





Parse error: syntax error, unexpected '$connection' (T_VARIABLE) in C:\xampp\htdocs\final\newmail.php on line 7




I don't know what the problem is – can anyone help me please?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...