Jump to content

[SOLVED] SQL error?


wwfc_barmy_army

Recommended Posts

UPDATE user SET 1 = [email protected]  WHERE user_id =123

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 = [email protected]
WHERE user_id = 123' at line 2 

 

Any ideas why i'm getting this error?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/109393-solved-sql-error/
Share on other sites

If you do have a column named 1, you need to use "quoting" to make it work -

 

Identifiers may begin with a digit but unless quoted may not consist solely of digits.

 

Quoting identifiers in mysql means to use the back-tick ` or double-quotes " around it.

Link to comment
https://forums.phpfreaks.com/topic/109393-solved-sql-error/#findComment-561232
Share on other sites

Ah thanks. I've tried that but i'm still getting an error:

 

Error

 

SQL query:

 

UPDATE user SET '1' = [email protected] WHERE user_id =123

 

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1' = [email protected] WHERE user_id = 123' at line 1

 

Any ideas?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/109393-solved-sql-error/#findComment-561270
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.