0

I am trying to make a edit profile page and i want the user to be able to change there username and email address. I've been going at this problem now for sometime and need your help.

Parse error: syntax error, unexpected T_VARIABLE

$edit = mysql_query("UPDATE users (Username, EmailAddress) VALUES('".$newusername."', '".$newemail."') WHERE UserID="$_SESSION['UserID']"");
1

1 Answer 1

4

you're missing some dots around $_SESSION['UserID']

$edit = mysql_query("UPDATE users (Username, EmailAddress) VALUES('".$newusername."', '".$newemail."') WHERE UserID=" . $_SESSION['UserID']);
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I'm not getting "Parse error: syntax error, unexpected '['"
@ritch: Please read Marek's answer carefully. You didn't use his code. I suggest you read about string concatenation and arrays.
@ritch: You must move the dot after $_SESSION after ['UserID'] so you have UserID = ".$_SESSION['UserID']."". And as Marek wrote, you may omit concating the empty string, so you have: UserID = ".$_SESSION['UserID'].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.