I cannot understand why xampp gives me an error
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\Permanent\edstul.php on line 31
Line 31 is this :
if($_POST){
//update the record if the form was submitted
$sql="UPDATE users SET pass='$_POST['pass']',fname='$_POST['fname']',lname='$_POST['lname']',mi='$_POST['mi']',age='$_POST['age']',course='$_POST['course']',yearlevel='$_POST['yearlevel']'
WHERE id=" . mysql_real_escape_string($_POST['id']);
if(mysql_query($sql)){
//this will be displayed when the query was successful
echo "<div>Record was edited.</div>";
}else{
die("SQL: " . $sql . " >> ERROR: " . mysql_error());
}
}
I cannot figure it out.I really hate declaring sql syntax because it doesn't have debugging.