/    Sign up×
Community /Pin to ProfileBookmark

Parse error: syntax error, unexpected T_VARIABLE

Hello,

Could someone tell me please where I have got error in this line ?

mysql_query(“UPDATE registerusers SET paid = ‘Y’, ammount = ‘”$resArray[‘AMT’]”‘, datepaid = ‘CURDATE()’ WHERE id = ‘”$_SESSION[kt_login_id]”‘”);

Thank you

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@SrWebDeveloperJan 25.2010 — mysql_query("UPDATE registerusers SET paid = 'Y', ammount = '"$resArray['AMT']"', datepaid = 'CURDATE()' WHERE id = '"$_SESSION[kt_login_id]"'");[/quote]

Could be:

[code=html]mysql_query("UPDATE registerusers SET paid = 'Y', ammount = '{$resArray['AMT']}', datepaid = 'CURDATE()' WHERE id = '$_SESSION[kt_login_id]'");
[/code]


You had double quotes surrounding the two associative arrays which is not necessary. I left the single quotes around each. I wrapped the first associative array with { and } because the key name is single quoted because in PHP that's how you embed associative arrays [I]with quoted key names[/I] in strings. I didn't bother to do that for the second associative array key name wasn't quoted. For each you could also have terminated the string with a double quote then used a period and the associative array then another period and a double quote as well, either way works.

-jim
Copy linkTweet thisAlerts:
@spacemocauthorJan 25.2010 — Jim,

Thank you so much, you are star !

Seb
×

Success!

Help @spacemoc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...