Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parsing error, formVariables 1

Status
Not open for further replies.

arm207

Programmer
Jun 13, 2006
26
0
0
US
for example...
$query = "UPDATE users SET user_name='$formVariables["username"]' ,


are the ' and " in the right places, I seem to be getting a parsing error. I need to know if there is something wrong with this syntax...
'$formVariables["username"]'
 
Look at your code. PHP parser can understand that string is anything between the opening and a matching closing quote. So, your opening is a double quote, your next double quote is before your username, so PHP believes your string is:
Code:
$query = "UPDATE users SET user_name='$formVariables["
From that point the parser is seriously confused by [tt]username"]' ,[/tt] and simply quits. I sugggest you rewrite your code to read:
Code:
$query = "UPDATE users SET user_name='" . $formVariables["username"] . "' , ...";
I believe your comma at the end is not the end of the string but that you meant your string continues. That's what I represented by three dots. Hope you had the correct closing of the string with the double quote and a semi-colon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top