|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
What's wrong with these UPDATE statements?
Hi,
I am having trouble updating a record in MySQL. Below are several different methods I have tried to use. The problem seems to be in the WHERE part, for when the query appears on multiple lines, the error message points to the line with the WHERE statement. Here are some of the ways I have tried: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
The error message I receive is: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in step1update.php on line 19 (line 19 in this case is $dbQuery .= "WHERE usrUsername='$_SESSION['user']';" ![]() So, I have tried updating only one field, or putting only one condition in the WHERE statement, but it makes no difference... The error message of of no help either: when I look it up in the PHP manual there's no reference for any of them; just the T_VARIABLE has a reference but is of no help. I'm stuck... Anyone has any ideas? Thanks for your help, Toine |
|
#2
|
||||
|
||||
|
The problem is that you're trying to nest quotes. Try reformatting your query lines according to the following example:
PHP Code:
(I don't know why the forum is insisting on sticking line breaks in the code. I've deleted them.) |
|
#3
|
|||
|
|||
|
Thanks, that method worked!
Thank you for your help, Toine |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > What's wrong with these UPDATE statements? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|